chore: clean up code by removing trailing whitespace and ensuring consistent formatting across various files = prettier

This commit is contained in:
Julien Froidefond
2025-12-01 08:37:30 +01:00
parent 757b1b84ab
commit e715779de7
98 changed files with 5453 additions and 3126 deletions

View File

@@ -6,4 +6,3 @@ import type { Account } from "./types";
export function getAccountBalance(account: Account): number {
return (account.initialBalance || 0) + account.balance;
}

View File

@@ -8,14 +8,10 @@ import { NextResponse } from "next/server";
*/
export async function requireAuth(): Promise<NextResponse | null> {
const session = await getServerSession(authOptions);
if (!session) {
return NextResponse.json(
{ error: "Non authentifié" },
{ status: 401 }
);
return NextResponse.json({ error: "Non authentifié" }, { status: 401 });
}
return null;
}

View File

@@ -3,16 +3,22 @@ import CredentialsProvider from "next-auth/providers/credentials";
import { authService } from "@/services/auth.service";
// Get secret with fallback for development
const secret = process.env.NEXTAUTH_SECRET || "dev-secret-key-change-in-production";
const secret =
process.env.NEXTAUTH_SECRET || "dev-secret-key-change-in-production";
// Debug: log secret status (remove in production)
if (process.env.NODE_ENV === "development") {
console.log("🔐 NextAuth secret:", process.env.NEXTAUTH_SECRET ? "✅ Loaded from .env.local" : "⚠️ Using fallback");
console.log(
"🔐 NextAuth secret:",
process.env.NEXTAUTH_SECRET
? "✅ Loaded from .env.local"
: "⚠️ Using fallback",
);
}
if (!process.env.NEXTAUTH_SECRET && process.env.NODE_ENV === "production") {
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.",
);
}
@@ -29,7 +35,9 @@ export const authOptions: NextAuthOptions = {
return null;
}
const isValid = await authService.verifyPassword(credentials.password);
const isValid = await authService.verifyPassword(
credentials.password,
);
if (!isValid) {
return null;
}
@@ -69,4 +77,3 @@ export const authOptions: NextAuthOptions = {
},
secret,
};