Skip to content

Commit

Permalink
updated information
Browse files Browse the repository at this point in the history
I specified that you can also get the user id on the frontend from "@teamhanko/hanko-elements" on the guide, before I was only referring to the email in this section

Commit Type: docs
  • Loading branch information
Esther-Lita committed Sep 27, 2023
1 parent 0062da7 commit e9eafe3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/docs/guides/tutorials/userId.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ obtain the data needed to identify a specific user.

## Get user ID from the JWT

On successful authentication, Hanko retreives a JWT contained inside of a cookie. One of the the thing
On successful authentication, Hanko retreives a JWT contained inside of a cookie. One of the the things
we can get from this JWT is the user ID, we can use [jose library](https://www.npmjs.com/package/jose) to decode
the value of such JWT:

Expand Down Expand Up @@ -60,7 +60,7 @@ console.log("user data:", userData);
## Get user data on the Frontend
If you only need the user email for a frontend usage, you can add this code to the same file where we are
If you only need the user email or the user id for a frontend usage, you can add this code to the same file where we are
registering the Hanko-Auth component:
```js
Expand Down Expand Up @@ -88,3 +88,4 @@ const redirectAfterLogin = useCallback(() => {
getEmail();
}, [router]);
```

0 comments on commit e9eafe3

Please sign in to comment.