Skip to content

Commit 7004b07

Browse files
custom error page
1 parent e1a4b15 commit 7004b07

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/web/src/app/login/error/page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ const ERROR_CONTENT: Record<string, { title: string; description: string }> = {
2020
title: "Access denied",
2121
description: "You do not have permission to sign in.",
2222
},
23+
EmailRequired: {
24+
title: "No email on your account",
25+
description: "Your identity provider didn't share an email address, which Sourcebot requires to sign you in. Add or verify an email on your upstream account, then try again.",
26+
},
2327
Verification: {
2428
title: "This sign-in link has expired",
2529
description: "The code or link you used is no longer valid - it may have expired or already been used. Request a new one and try again.",

packages/web/src/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ const nextAuthResult = NextAuth(async () => ({
321321
// Reject any sign-in that arrives without an email.
322322
// @see 20260616000000_make_user_email_required/migration.sql
323323
if (!user.email) {
324-
return false;
324+
return '/login/error?error=EmailRequired';
325325
}
326326

327327
return true;

0 commit comments

Comments
 (0)