Is there an easy way to add claims (like the user...
# support-questions-legacy
p
Is there an easy way to add claims (like the users email) to the session on the frontend? Asking because im following the flow for OIDC login with Okta with a custom built UI and we have to call signInAndUp() from the frontend like here https://supertokens.com/docs/thirdparty/custom-ui/thirdparty-login. We get the users email from the signInAndUp response but not sure where we can add it to the session from here. Unless maybe added a custom next api route to invoke the createNewSession function from supertokens-node?
r
hey @puff6248 you can use the createNewSession override to add any info in the session claim: https://supertokens.com/docs/thirdparty/common-customizations/sessions/claims/access-token-payload The input to the createNewSession contains the userId, using which you can fetch the the user's email (https://supertokens.com/docs/thirdparty/common-customizations/get-user-info)
p
This works, thank you
11 Views