#Next Auth / Firebase
1 messages · Page 1 of 1 (latest)
cool thanks!
ok i see
it doesnt need to be firebase, i just want to understand how the authentification stuff works in general
if you have firebase, nextauth is not mandatory
it’s a custom auth implementation for people who does not have auth services
i see
it replace firebase auth, supabase auth etc
yes, that was my impression... but i still dont know how i would use middleware myself without next auth
i was a firebase user before too
my impression is that i need to set the jwt from firebase auth as a request header in the client
firebase is intended (or was) to be used client side for people with no backend
and then read it out in the middlewear
can you or will you query from your backend ?
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
sounds a good plan
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
it should with the middleware
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
thanks so much!!