I'm implementing my own login and signup UI's on a...
# support-questions
m
I'm implementing my own login and signup UI's on a NextJS project by following the steps in this blog post: https://supertokens.com/blog/adding-social-login-to-your-website-with-supertokens I've made a route on the frontend for the callback, but how should I handle redirects? For example, I try to access a secure page, get directed to login, login with google, directs me to the
redirect_uri
, that page handles the
/auth/signinup
, how should I properly handle sending my user back to the initial protected page?
r
You can store which page the user came from in local storage before redirecting them to the social provider’s site
And when they come back to your app, after successful sign in / up, you can read that value form localstorage and take them back to that page.
m
Thanks. That's pretty much what I ended up doing. I watched what the widget did and mimicked that, though I don't know exactly what the state uid is for other than confirming that the sessionStorage object matches the redirect back from the auth provider.
r
Yea. It’s basically to make sure that you end up consuming the code only if you generated it.
2 Views