mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
feat(auth): implement email verification process with resend functionality and update registration flow
This commit is contained in:
@@ -8,6 +8,7 @@ import { db } from '@/lib/db';
|
||||
import { ProjectMemberRole, WorkspaceMemberRole } from '@prisma/client';
|
||||
import { hasBillingAccess } from '@/lib/billing';
|
||||
import { isInviteCodeRequired } from '@/lib/feature-flags';
|
||||
import { isEmailVerificationEnabled } from '@/lib/email-verification';
|
||||
|
||||
// Dummy hash for timing-safe comparison when user doesn't exist
|
||||
// This prevents user enumeration via timing attacks
|
||||
@@ -47,6 +48,11 @@ export const { handlers, signIn, signOut, auth } = NextAuth({
|
||||
return null;
|
||||
}
|
||||
|
||||
// Block sign-in when email verification is required but not yet completed
|
||||
if (isEmailVerificationEnabled() && !user.emailVerified) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
|
||||
Reference in New Issue
Block a user