aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/server/auth.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/server/auth.ts')
-rw-r--r--apps/web/server/auth.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/web/server/auth.ts b/apps/web/server/auth.ts
index 483d1522..042be1ae 100644
--- a/apps/web/server/auth.ts
+++ b/apps/web/server/auth.ts
@@ -114,7 +114,7 @@ if (oauth.wellKnownUrl) {
]);
return {
id: profile.sub,
- name: profile.name,
+ name: profile.name || profile.email,
email: profile.email,
image: profile.picture,
role: admin || firstUser ? "admin" : "user",
@@ -146,7 +146,7 @@ export const authOptions: NextAuthOptions = {
if (credentials) {
return true;
}
- if (!profile?.email || !profile?.name) {
+ if (!profile?.email) {
throw new Error("No profile");
}
const [{ count: userCount }] = await db