https://supertokens.com/ logo
#support-questions
Title
# support-questions
i

Infatuation

04/17/2022, 6:31 PM
In the signinuppost function I'm overriding it and doing an API call with the user's access token to get their discord user data. This works, but I'm wondering how I pass this info to the session. I have overriden the session function as well, so do I just pass this variable through the usercontext?
r

rp

04/17/2022, 6:31 PM
hey
i

Infatuation

04/17/2022, 6:32 PM
Hi!
r

rp

04/17/2022, 6:32 PM
the session function is called in the originalImplementation.signinuppost function
so if you are overriding the
signinuppost
function and using the access token after the originalImplementation returns, then updating the user context won't help
Instead, the return
originalImplementation.signinuppost
is an object that contains the
session
object
you can use
session.updateAccessTokenPayload
to update the payload info.
i

Infatuation

04/17/2022, 6:55 PM
I'm a bit confused, I don't notice the session object being in the signinuppost original implementation, at least in Go. Here's my pastebin: https://pastebin.com/kazrUJiS
Copy code
go
type SignInUpPOSTResponse struct {
    OK *struct {
        CreatedNewUser   bool
        User             User
        Session          sessmodels.SessionContainer
        AuthCodeResponse interface{}
    }
    NoEmailGivenByProviderError *struct{}
    FieldError                  *struct{ ErrorMsg string }
}
i

Infatuation

04/17/2022, 6:58 PM
OHH
it's part of the ok struct
r

rp

04/17/2022, 6:58 PM
yea. cause only if is OK, will there be a session
i

Infatuation

04/17/2022, 6:58 PM
I see!
r

rp

04/17/2022, 6:58 PM
in other situations, there is no session created
i

Infatuation

04/17/2022, 6:58 PM
okay that makes a lot of sense, thank you