-
I'm following the code example in https://next-auth.js.org/adapters/firebase but I can't make it work. Any solutions? My current code. import NextAuth, { type NextAuthOptions } from "next-auth";
import { FirestoreAdapter } from "@next-auth/firebase-adapter";
import GoogleProvider from "next-auth/providers/google";
import { initializeApp, getApp, getApps } from "firebase/app";
import { getFirestore } from "firebase/firestore";
import { getAuth } from "firebase/auth";
const firebaseConfig = {
apiKey: process.env.FIREBASE_API_KEY,
appId: process.env.FIREBASE_APP_ID,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
projectId: process.env.FIREBASE_PROJECT_ID,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
measurementId: process.env.FIREBASE_MEASUREMENT_ID,
};
export const app = !getApps().length ? initializeApp(firebaseConfig) : getApp();
export const auth = getAuth(app);
export const db = getFirestore(app);
export const authOptions: NextAuthOptions = {
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_ID || "",
clientSecret: process.env.GOOGLE_SECRET || "",
}),
],
adapter: FirestoreAdapter(firebaseConfig),
};
export default NextAuth(authOptions); |
Beta Was this translation helpful? Give feedback.
Answered by
eddyhdzg
Sep 20, 2022
Replies: 1 comment
-
I just had to add a url on the the Authorized redirect URIs on the GCP console... |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
eddyhdzg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just had to add a url on the the Authorized redirect URIs on the GCP console...