chore: clean up .dockerignore and standardize formatting in auth.ts for improved readability
This commit is contained in:
@@ -17,3 +17,5 @@ README.md
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ if (process.env.NODE_ENV === "development") {
|
|||||||
"🔐 NextAuth secret:",
|
"🔐 NextAuth secret:",
|
||||||
process.env.NEXTAUTH_SECRET
|
process.env.NEXTAUTH_SECRET
|
||||||
? "✅ Loaded from .env.local"
|
? "✅ Loaded from .env.local"
|
||||||
: "⚠️ Using fallback"
|
: "⚠️ Using fallback",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!process.env.NEXTAUTH_SECRET && process.env.NODE_ENV === "production") {
|
if (!process.env.NEXTAUTH_SECRET && process.env.NODE_ENV === "production") {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"NEXTAUTH_SECRET is required in production. Please set it in your environment variables."
|
"NEXTAUTH_SECRET is required in production. Please set it in your environment variables.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ export const authOptions: NextAuthOptions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isValid = await authService.verifyPassword(
|
const isValid = await authService.verifyPassword(
|
||||||
credentials.password
|
credentials.password,
|
||||||
);
|
);
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user