Skip to content

How would I use Blitz.js with the exisiting auth system? #2862

Answered by flybayer
heauton asked this question in Q&A
Discussion options

You must be logged in to vote

Good question! I looked through the Supabase docs and examples, and it seems they only support client-side auth. So to have authenticated server calls, you will need to use something in addition to supabase (like blitz auth).

What you can do, I think, is replace the default logic inside the blitz login mutation to instead call supabase.auth.signIn(). And if successful, call ctx.session.$create() like normal blitz auth.

So in essence, you are using supabase to manage the identity verification, but then using blitz to manage the session.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@heauton
Comment options

@flybayer
Comment options

@beerose
Comment options

Answer selected by heauton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants