Aktueller Stand
This commit is contained in:
@@ -4,6 +4,7 @@ import type { NextAuthOptions } from "next-auth";
|
||||
import CredentialsProvider from "next-auth/providers/credentials";
|
||||
import { prisma } from "./prisma";
|
||||
import { checkRateLimit, getRateLimitConfig } from "./rate-limit";
|
||||
import { getEmailVerificationRequired } from "./system-settings";
|
||||
|
||||
const MAX_LOGIN_ATTEMPTS = 5;
|
||||
const LOGIN_WINDOW_MINUTES = 15;
|
||||
@@ -139,7 +140,8 @@ export const authOptions: NextAuthOptions = {
|
||||
throw new Error("PENDING");
|
||||
}
|
||||
|
||||
if (!user.emailVerified) {
|
||||
const emailVerificationRequired = await getEmailVerificationRequired();
|
||||
if (emailVerificationRequired && !user.emailVerified) {
|
||||
throw new Error("EMAIL_NOT_VERIFIED");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user