added config for google auth

This commit is contained in:
2024-01-07 13:08:29 +01:00
parent 15b164ce3c
commit 8367606493
7 changed files with 42 additions and 4 deletions

17
auth.config.google.ts Normal file
View File

@@ -0,0 +1,17 @@
import NextAuth, { NextAuthConfig } from 'next-auth';
import GoogleProvider from 'next-auth/providers/google';
export const authConfig:NextAuthConfig = {
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
}),
],
session: {
// Use JSON Web Tokens for session instead of database sessions.
// This option can be used with or without a database for users/accounts.
// Note: `jwt` is automatically set to `true` if no database is specified.
strategy: 'jwt'
},
};