do those custom keys get persisted in a sticky way across sessions? Or are they lost on session refresh / if the user logs in on a different device for ex.
r
rp_st
09/29/2023, 6:02 PM
Hey @n8levine. They are persisted across session refreshing. But don’t get replicated into other device’s sessions.
n
n8levine
09/29/2023, 9:39 PM
Ah okay thanks. What would be the best way to ensure that certain keys are always set then (i.e. on sign-in and sign-up).
I know you can override those sign-in/up methods, which I've been doing w/ the ThirdPartyEmailPassword recipe. But can you trivially access the session inside there too and add to the payload?
r
rp_st
09/30/2023, 5:44 AM
yes you can. You can override the createNewSession function in the session recipe and add the custom claims there.
n
n8levine
09/30/2023, 3:51 PM
Okay I see. But I mean, can you also access the session and add to the access token payload when you override
emailPasswordSignUp
for ex. ?
r
rp_st
09/30/2023, 4:13 PM
Then override.apis yea, not the override.functions, since the session hasn’t been created when the override.functions is run for emailpassword login. But during the override.apis, the session gets created and is returned as a result of calling it’s original impl
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).