Replies: 1 comment 11 replies
-
If you import auth from auth.ts into your pages, you will be able to extract the email as in the following example import { auth as AppAuth } from '@/auth';
export default async function Page() {
const temp = await AppAuth()
return <p>Hello {temp?.user.email}</p>
} However, this doesn't solve the problem. Even though the login and signout logic is working, the user doesn't maintain authentication by the Firebase service across pages. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
I'm currently working on integrating Firebase authentication with NextAuth v5 in a Next.js 14.0 application, following the Adding Authentication guide. However, I'm encountering difficulties in getting Firebase to work alongside NextAuth for user authentication and session management.
Expected Behavior:
Users should be able to log in using Firebase authentication, and their session state should be managed by NextAuth.
Current Behavior:
I can log the user in on the server, however the client is not updated, so I when access information on the user (i.e. refreshed auth tokens), it is not available.
When i access
auth.currentUser
I getnull
LoginForm.tsx
Firebase Actions (/firebase/actions.ts):
NextAuth (/auth.ts):
Beta Was this translation helpful? Give feedback.
All reactions