Skip to content

Commit cde56ac

Browse files
docs(README): use current jwt-decode style (#348)
1 parent 13c7150 commit cde56ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,14 @@ All API documentation is generated by typedoc, and [is available in the `typedoc
331331
- You can get the email address by parsing the JWT token that's returned from any authentication, like so:
332332
```js
333333
import { appleAuth } from '@invertase/react-native-apple-authentication';
334-
import jwt_decode from 'jwt-decode';
334+
import { jwtDecode } from 'jwt-decode';
335335

336336
const appleAuthRequestResponse = await appleAuth.performRequest({
337337
requestedOperation: appleAuth.Operation.LOGIN,
338338
requestedScopes: [appleAuth.Scope.EMAIL, appleAuth.Scope.FULL_NAME]
339339
});
340340
// other fields are available, but full name is not
341-
const { email, email_verified, is_private_email, sub } = jwt_decode(appleAuthRequestResponse.identityToken)
341+
const { email, email_verified, is_private_email, sub } = jwtDecode(appleAuthRequestResponse.identityToken)
342342
```
343343

344344
## Troubleshooting

0 commit comments

Comments
 (0)