using firebase auth with app router
Unanswered
House Wren posted this in #help-forum
House WrenOP
Hi all! I'm trying to do anonymous auth with Firebase auth for an SSR app using app router. We want all users to be anonymously authenticated with Firebase so that when you visit one of our pages, you are either already authenticated (maybe there's an http-only cookie already set) or you get automatically authenticated, so no need to enter any credentials.
I know you can do this in a middleware, however, firebase-admin uses crypto which is a nodejs module 😦
So far my thinking is using https://nextjs.org/docs/app/api-reference/functions/cookies to get/set a cookie using the Firebase admin sdk? though I'm not sure how to actually "set" the cookie along with the result of the react server component. Any insights?
Thank you all in advance!
I know you can do this in a middleware, however, firebase-admin uses crypto which is a nodejs module 😦
So far my thinking is using https://nextjs.org/docs/app/api-reference/functions/cookies to get/set a cookie using the Firebase admin sdk? though I'm not sure how to actually "set" the cookie along with the result of the react server component. Any insights?
Thank you all in advance!