fixed by lint
This commit is contained in:
parent
86d26a1e41
commit
b53c186342
@ -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' },
|
||||
|
@ -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' },
|
||||
|
@ -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' },
|
||||
|
@ -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' },
|
||||
|
@ -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' },
|
||||
|
@ -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' },
|
||||
|
@ -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' },
|
||||
|
@ -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' },
|
||||
|
@ -77,7 +77,7 @@ async function verifyAdminToken(): Promise<boolean> {
|
||||
|
||||
export async function checkAdminAuth(password?: string): Promise<boolean> {
|
||||
// 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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user