Hey All, I'm storing custom sign up fields in the user metadata and I want to put them in the access token payload. So I override the signUpPOST and the createNewSession ... the issue is that on sign up the user metadata is still empty for the createNewSession method and so the access token on the frontend will not contain the metadata fields. Is there a way to bypass this? Maybe on post sign up on the frontend, refresh the token explicitly ? Is that possible ? thanks
r
rp_st
08/05/2022, 7:33 PM
Hey! The signInUpPOST function represents the whole sign up API. The original implementation call of that calls the sessions’s createNewSession function.
rp_st
08/05/2022, 7:34 PM
So if you want to modify the session payload after calling the original implementation, you should get the session from the response of calling the originalImplementation and call the updateAccessTokenPayload function on that session object
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).