mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-21 14:29:20 -06:00
add google provider to nextauth
This commit is contained in:
@@ -92,3 +92,5 @@ GITHUB_SECRET=
|
||||
|
||||
# Configure Google Login
|
||||
NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=0
|
||||
GOOGLE_CLIENT_ID=
|
||||
GOOGLE_CLIENT_SECRET=
|
||||
@@ -92,6 +92,8 @@ GITHUB_SECRET=
|
||||
|
||||
# Configure Google Login
|
||||
NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=0
|
||||
GOOGLE_CLIENT_ID=
|
||||
GOOGLE_CLIENT_SECRET=
|
||||
|
||||
|
||||
# Stripe Billing Variables
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { IdentityProvider } from "@prisma/client";
|
||||
import type { NextAuthOptions } from "next-auth";
|
||||
import CredentialsProvider from "next-auth/providers/credentials";
|
||||
import GitHubProvider from "next-auth/providers/github";
|
||||
import GoogleProvider from "next-auth/providers/google";
|
||||
|
||||
export const authOptions: NextAuthOptions = {
|
||||
providers: [
|
||||
@@ -122,6 +123,11 @@ export const authOptions: NextAuthOptions = {
|
||||
clientId: process.env.GITHUB_ID || "",
|
||||
clientSecret: process.env.GITHUB_SECRET || "",
|
||||
}),
|
||||
GoogleProvider({
|
||||
clientId: process.env.GOOGLE_CLIENT_ID || "",
|
||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET || "",
|
||||
allowDangerousEmailAccountLinking: true,
|
||||
}),
|
||||
],
|
||||
callbacks: {
|
||||
async jwt({ token }) {
|
||||
|
||||
@@ -16,6 +16,10 @@ const nextConfig = {
|
||||
protocol: "https",
|
||||
hostname: "avatars.githubusercontent.com",
|
||||
},
|
||||
{
|
||||
protocol: "https",
|
||||
hostname: "lh3.googleusercontent.com",
|
||||
},
|
||||
],
|
||||
},
|
||||
async headers() {
|
||||
|
||||
@@ -316,6 +316,7 @@ model ApiKey {
|
||||
enum IdentityProvider {
|
||||
email
|
||||
github
|
||||
google
|
||||
}
|
||||
|
||||
model Account {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
"FORMBRICKS_LEGACY_HOST",
|
||||
"GITHUB_ID",
|
||||
"GITHUB_SECRET",
|
||||
"GOOGLE_CLIENT_ID",
|
||||
"GOOGLE_CLIENT_SECRET",
|
||||
"HEROKU_APP_NAME",
|
||||
"INSTANCE_ID",
|
||||
"INTERNAL_SECRET",
|
||||
|
||||
Reference in New Issue
Block a user