Closed Bowis closed 1 year ago
I have the same problem.
I also get: next-firebase-auth: [verifyIdToken] Successfully verified the ID token. The user is authenticated. next-firebase-auth: [setAuthCookies] Getting a refresh token from the ID token. next-firebase-auth: [setAuthCookies] Failed to verify the ID token. Cannot authenticate the user or get a refresh token. next-firebase-auth: [setAuthCookies] Set auth cookies. The user is not authenticated.
@Bowis now it works for me, the trick is to define your FIREBASE_PRIVATE_KEY like this
FIREBASE_PRIVATE_KEY='"
When filing a bug report, please confirm you've done the following:
Describe the bug 0
I have the following setup using Next-firebase-auth:
Login page:
Protected page:
Config:
Versions
next-firebase-auth
version: 1.0.0-canary.18 Firebase JS SDK: 9.12.1 Next.js: latestTo Reproduce After logging in, i get the next-firebase-auth: [getUserFromCookies] Failed to retrieve the ID token from cookies. This will happen if the user is not logged in, the provided cookie values are invalid, or the cookie values don't align with your cookie settings. The user will be unauthenticated. error, which redirects me to the login page, which in turn redirects me to the protected page again, creating an endless loop. When inspecting the cookies, I do see that they are being written, so I'm not sure where it is going wrong at the moment.