Skip to content
Discussion options

You must be logged in to vote

Yes, actually! Though it's been quite some time, the refreshSession() is definitely not a suitable method for deep linking.

Instead, we need to get the hashed_token somehow, so that it's sent back to the app and the app creates a separate session with auth.verifyOtp().

So what I'm doing is sending user to site.com/auth/login?desktop=true, they complete login, server takes the new session, gets the user email from auth.getUser(), and then completely unexpected (for me):

// Generate magic link for user
// obviously need a service role key for this,
// so ensure it's secure
const { data: magicLink, error: magicLinkErr } = await supabaseAdmin.auth.admin.generateLink({
   type: 'magiclink',

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@igorlanko
Comment options

Answer selected by igorlanko
@yafkari
Comment options

@jczstudios
Comment options

@jparismorgan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants