Skip to content

Commit fbdedf7

Browse files
committed
fix(webapp): clearer login error when WHITELISTED_EMAILS rejects an address
1 parent f35965c commit fbdedf7

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Clearer login error when an email address is blocked by the WHITELISTED_EMAILS setting: the message now explains the address isn't allowed on this instance instead of the ambiguous "This email is unauthorized".

apps/webapp/app/utils/email.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export function assertEmailAllowed(email: string) {
77
}
88

99
if (!emailMatchesPattern(env.WHITELISTED_EMAILS, email)) {
10-
throw new Error("This email is unauthorized");
10+
// Surfaced verbatim on the login page. Name the actual policy so a
11+
// rejection on a restricted instance reads as configuration, not a bug.
12+
throw new Error("This email address isn't allowed to sign in on this instance.");
1113
}
1214
}

0 commit comments

Comments
 (0)