From b53c1863425f396790118fd8f0760adabd1b050b Mon Sep 17 00:00:00 2001 From: Jean Jacques Avril Date: Sun, 2 Mar 2025 17:15:57 +0000 Subject: [PATCH] fixed by lint --- src/app/api/editable-text/route.ts | 2 +- src/app/api/generate-bulk-tokens/route.ts | 2 +- src/app/api/generate-token/route.ts | 2 +- src/app/api/members/route.ts | 4 ++-- src/app/api/reset-votes/route.ts | 2 +- src/app/api/stats/route.ts | 2 +- src/app/api/toggle-member-auth/route.ts | 2 +- src/app/api/upload-members/route.ts | 2 +- src/lib/auth.ts | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/api/editable-text/route.ts b/src/app/api/editable-text/route.ts index 3e853c4..4b47caf 100644 --- a/src/app/api/editable-text/route.ts +++ b/src/app/api/editable-text/route.ts @@ -86,7 +86,7 @@ export async function POST(request: NextRequest) { const body = await request.json(); // Check for admin auth const { password, } = body; - let isAuthenticated = await checkAdminAuth(password); + const isAuthenticated = await checkAdminAuth(password); if (!isAuthenticated) { return NextResponse.json( { error: 'Unauthorized' }, diff --git a/src/app/api/generate-bulk-tokens/route.ts b/src/app/api/generate-bulk-tokens/route.ts index 68b4532..dd451dd 100644 --- a/src/app/api/generate-bulk-tokens/route.ts +++ b/src/app/api/generate-bulk-tokens/route.ts @@ -6,7 +6,7 @@ export async function POST(request: NextRequest) { const body = await request.json(); // Check for admin auth const { password } = body; - let isAuthenticated = await checkAdminAuth(password); + const isAuthenticated = await checkAdminAuth(password); if (!isAuthenticated) { return NextResponse.json( { error: 'Unauthorized' }, diff --git a/src/app/api/generate-token/route.ts b/src/app/api/generate-token/route.ts index 172075f..8a6faad 100644 --- a/src/app/api/generate-token/route.ts +++ b/src/app/api/generate-token/route.ts @@ -9,7 +9,7 @@ export async function POST(request: NextRequest) { const body = await request.json(); // Check for admin auth const { password } = body; - let isAuthenticated = await checkAdminAuth(password); + const isAuthenticated = await checkAdminAuth(password); if (!isAuthenticated) { return NextResponse.json( { error: 'Unauthorized' }, diff --git a/src/app/api/members/route.ts b/src/app/api/members/route.ts index 8bdb6cf..9afdda9 100644 --- a/src/app/api/members/route.ts +++ b/src/app/api/members/route.ts @@ -5,7 +5,7 @@ import { NextRequest, NextResponse } from 'next/server'; export async function GET(request: NextRequest) { try { // Check for admin auth - let isAuthenticated = await checkAdminAuth(); + const isAuthenticated = await checkAdminAuth(); if (!isAuthenticated) { return NextResponse.json( { error: 'Unauthorized' }, @@ -36,7 +36,7 @@ export async function POST(request: NextRequest) { const body = await request.json(); // Check for admin auth const { password } = body; - let isAuthenticated = await checkAdminAuth(password); + const isAuthenticated = await checkAdminAuth(password); if (!isAuthenticated) { return NextResponse.json( { error: 'Unauthorized' }, diff --git a/src/app/api/reset-votes/route.ts b/src/app/api/reset-votes/route.ts index e764d53..1af5a42 100644 --- a/src/app/api/reset-votes/route.ts +++ b/src/app/api/reset-votes/route.ts @@ -9,7 +9,7 @@ export async function POST(request: NextRequest) { const body = await request.json(); // Check for admin auth const { password } = body; - let isAuthenticated = await checkAdminAuth(password); + const isAuthenticated = await checkAdminAuth(password); if (!isAuthenticated) { return NextResponse.json( { error: 'Unauthorized' }, diff --git a/src/app/api/stats/route.ts b/src/app/api/stats/route.ts index 46acef2..c368501 100644 --- a/src/app/api/stats/route.ts +++ b/src/app/api/stats/route.ts @@ -9,7 +9,7 @@ export async function POST(request: NextRequest) { const { password } = body; // Check for admin auth - let isAuthenticated = await checkAdminAuth(password); + const isAuthenticated = await checkAdminAuth(password); if (!isAuthenticated) { return NextResponse.json( { error: 'Unauthorized' }, diff --git a/src/app/api/toggle-member-auth/route.ts b/src/app/api/toggle-member-auth/route.ts index 98e491f..514ee1a 100644 --- a/src/app/api/toggle-member-auth/route.ts +++ b/src/app/api/toggle-member-auth/route.ts @@ -7,7 +7,7 @@ export async function POST(request: NextRequest) { const body = await request.json(); // Check for admin auth const { password } = body; - let isAuthenticated = await checkAdminAuth(password); + const isAuthenticated = await checkAdminAuth(password); if (!isAuthenticated) { return NextResponse.json( { error: 'Unauthorized' }, diff --git a/src/app/api/upload-members/route.ts b/src/app/api/upload-members/route.ts index 20bb3b5..be39835 100644 --- a/src/app/api/upload-members/route.ts +++ b/src/app/api/upload-members/route.ts @@ -7,7 +7,7 @@ export async function POST(request: NextRequest) { const body = await request.json(); const { password } = body; // Check for admin auth - let isAuthenticated = await checkAdminAuth(password); + const isAuthenticated = await checkAdminAuth(password); if (!isAuthenticated) { return NextResponse.json( { error: 'Unauthorized' }, diff --git a/src/lib/auth.ts b/src/lib/auth.ts index 7182abe..f65587e 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -77,7 +77,7 @@ async function verifyAdminToken(): Promise { export async function checkAdminAuth(password?: string): Promise { // Get admin password from environment variable or use default for development - let isAuthenticated = await verifyAdminToken(); + const isAuthenticated = await verifyAdminToken(); if (isAuthenticated) return true; if (password) { const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || 'schafwaschener-segelverein-admin';