Skip to content

Commit 8ad44e3

Browse files
committed
feat: skip email verification check in local development
- Allow unverified users to login when PLUNK_API_KEY is not set or starts with 'dev-' - Improves local development experience - no need to verify email - Production still requires email verification for security
1 parent ef8f694 commit 8ad44e3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • services/account-api/src/routes

services/account-api/src/routes/auth.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ auth.post("/login", async (c) => {
3636
throw errors.unauthorized("Invalid credentials");
3737
}
3838

39-
// Check if email is verified
40-
if (!user.email_verified) {
39+
// Check if email is verified (skip check in local dev environment)
40+
const isLocalDev =
41+
!c.env.PLUNK_API_KEY || c.env.PLUNK_API_KEY.startsWith("dev-");
42+
if (!user.email_verified && !isLocalDev) {
4143
throw errors.unauthorized("Please verify your email before logging in");
4244
}
4345

0 commit comments

Comments
 (0)