#Next Auth / Firebase

1 messages · Page 1 of 1 (latest)

molten osprey
#

should be easier here

abstract olive
#

cool thanks!

molten osprey
#

ok i see

abstract olive
#

it doesnt need to be firebase, i just want to understand how the authentification stuff works in general

molten osprey
#

if you have firebase, nextauth is not mandatory

#

it’s a custom auth implementation for people who does not have auth services

abstract olive
#

i see

molten osprey
#

it replace firebase auth, supabase auth etc

abstract olive
#

yes, that was my impression... but i still dont know how i would use middleware myself without next auth

molten osprey
#

i was a firebase user before too

abstract olive
#

my impression is that i need to set the jwt from firebase auth as a request header in the client

molten osprey
#

firebase is intended (or was) to be used client side for people with no backend

abstract olive
#

and then read it out in the middlewear

molten osprey
#

can you or will you query from your backend ?

abstract olive
#

that was my plan

#

in the middleware create a matcher

#

and for some protected routes, query against the backend for the list of authenticated users

#

then read out the email adress from the authentification token

molten osprey
#

sounds a good plan

abstract olive
#

does next auth automatically put auth stuff into the request header?

#

because this is what puzzled me, i wouldnt know how to do it myself

molten osprey
#

you use the official adapter, so it should be linked to firebase auth now

#

i think this is what you are looking for

#

match on route you want to protect, and challenge the session to match specific users

#

the doc is transitioning. hard to find a reliable example

#

the ambition to be framework agnostic so thia is why

abstract olive
#

thanks so much!!