Join Discord
Powered by
Is there a way to get ip address from userContext?...
# support-questions-legacy
b
bladerpc
05/22/2023, 3:54 AM
Is there a way to get ip address from userContext? Trying to get user ip address when overriding sign up function
bladerpc
05/22/2023, 3:55 AM
_default?
https://supertokens.com/docs/passwordless/advanced-customizations/user-context#default-information-in-the-user-context-object
bladerpc
05/22/2023, 4:56 AM
https://github.com/supertokens/supertokens-golang/blob/ebc16c1db7ffbe0f11147444b502c18eae4a1c87/test/auth-react-server/main.go#L621
was a good example on how to use user context
n
nkshah2
05/22/2023, 6:17 AM
Hi
@bladerpc
Yep, userContext["_default"]["request"] is the original request object. You can consume it how you normally would in non supertokens APIs
b
bladerpc
05/22/2023, 6:22 AM
It would be nice if there was a typed version of it, something like a receiver function of func (c *UserContext) GetDefaultRequest()
bladerpc
05/22/2023, 6:22 AM
but yea i got it, thank you! was adding recaptcha to the sign up 🙂
r
rp_st
05/22/2023, 6:27 AM
Yea fair. We are working on it.
9
Views
Previous
Next