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(); |     const body = await request.json(); | ||||||
|     // Check for admin auth
 |     // Check for admin auth
 | ||||||
|     const { password, } = body; |     const { password, } = body; | ||||||
|     let isAuthenticated = await checkAdminAuth(password); |     const isAuthenticated = await checkAdminAuth(password); | ||||||
|     if (!isAuthenticated) { |     if (!isAuthenticated) { | ||||||
|       return NextResponse.json( |       return NextResponse.json( | ||||||
|         { error: 'Unauthorized' }, |         { error: 'Unauthorized' }, | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ export async function POST(request: NextRequest) { | |||||||
|     const body = await request.json(); |     const body = await request.json(); | ||||||
|     // Check for admin auth
 |     // Check for admin auth
 | ||||||
|     const { password } = body; |     const { password } = body; | ||||||
|     let isAuthenticated = await checkAdminAuth(password); |     const isAuthenticated = await checkAdminAuth(password); | ||||||
|     if (!isAuthenticated) { |     if (!isAuthenticated) { | ||||||
|       return NextResponse.json( |       return NextResponse.json( | ||||||
|         { error: 'Unauthorized' }, |         { error: 'Unauthorized' }, | ||||||
|  | |||||||
| @ -9,7 +9,7 @@ export async function POST(request: NextRequest) { | |||||||
|     const body = await request.json(); |     const body = await request.json(); | ||||||
|     // Check for admin auth
 |     // Check for admin auth
 | ||||||
|     const { password } = body; |     const { password } = body; | ||||||
|     let isAuthenticated = await checkAdminAuth(password); |     const isAuthenticated = await checkAdminAuth(password); | ||||||
|     if (!isAuthenticated) { |     if (!isAuthenticated) { | ||||||
|       return NextResponse.json( |       return NextResponse.json( | ||||||
|         { error: 'Unauthorized' }, |         { error: 'Unauthorized' }, | ||||||
|  | |||||||
| @ -5,7 +5,7 @@ import { NextRequest, NextResponse } from 'next/server'; | |||||||
| export async function GET(request: NextRequest) { | export async function GET(request: NextRequest) { | ||||||
|   try { |   try { | ||||||
|     // Check for admin auth
 |     // Check for admin auth
 | ||||||
|     let isAuthenticated = await checkAdminAuth(); |     const isAuthenticated = await checkAdminAuth(); | ||||||
|     if (!isAuthenticated) { |     if (!isAuthenticated) { | ||||||
|       return NextResponse.json( |       return NextResponse.json( | ||||||
|         { error: 'Unauthorized' }, |         { error: 'Unauthorized' }, | ||||||
| @ -36,7 +36,7 @@ export async function POST(request: NextRequest) { | |||||||
|     const body = await request.json(); |     const body = await request.json(); | ||||||
|     // Check for admin auth
 |     // Check for admin auth
 | ||||||
|     const { password } = body; |     const { password } = body; | ||||||
|     let isAuthenticated = await checkAdminAuth(password); |     const isAuthenticated = await checkAdminAuth(password); | ||||||
|     if (!isAuthenticated) { |     if (!isAuthenticated) { | ||||||
|       return NextResponse.json( |       return NextResponse.json( | ||||||
|         { error: 'Unauthorized' }, |         { error: 'Unauthorized' }, | ||||||
|  | |||||||
| @ -9,7 +9,7 @@ export async function POST(request: NextRequest) { | |||||||
|     const body = await request.json(); |     const body = await request.json(); | ||||||
|     // Check for admin auth
 |     // Check for admin auth
 | ||||||
|     const { password } = body; |     const { password } = body; | ||||||
|     let isAuthenticated = await checkAdminAuth(password); |     const isAuthenticated = await checkAdminAuth(password); | ||||||
|     if (!isAuthenticated) { |     if (!isAuthenticated) { | ||||||
|       return NextResponse.json( |       return NextResponse.json( | ||||||
|         { error: 'Unauthorized' }, |         { error: 'Unauthorized' }, | ||||||
|  | |||||||
| @ -9,7 +9,7 @@ export async function POST(request: NextRequest) { | |||||||
|     const { password } = body; |     const { password } = body; | ||||||
| 
 | 
 | ||||||
|     // Check for admin auth
 |     // Check for admin auth
 | ||||||
|     let isAuthenticated = await checkAdminAuth(password); |     const isAuthenticated = await checkAdminAuth(password); | ||||||
|     if (!isAuthenticated) { |     if (!isAuthenticated) { | ||||||
|       return NextResponse.json( |       return NextResponse.json( | ||||||
|         { error: 'Unauthorized' }, |         { error: 'Unauthorized' }, | ||||||
|  | |||||||
| @ -7,7 +7,7 @@ export async function POST(request: NextRequest) { | |||||||
|     const body = await request.json(); |     const body = await request.json(); | ||||||
|     // Check for admin auth
 |     // Check for admin auth
 | ||||||
|     const { password } = body; |     const { password } = body; | ||||||
|     let isAuthenticated = await checkAdminAuth(password); |     const isAuthenticated = await checkAdminAuth(password); | ||||||
|     if (!isAuthenticated) { |     if (!isAuthenticated) { | ||||||
|       return NextResponse.json( |       return NextResponse.json( | ||||||
|         { error: 'Unauthorized' }, |         { error: 'Unauthorized' }, | ||||||
|  | |||||||
| @ -7,7 +7,7 @@ export async function POST(request: NextRequest) { | |||||||
|     const body = await request.json(); |     const body = await request.json(); | ||||||
|     const { password } = body; |     const { password } = body; | ||||||
|     // Check for admin auth
 |     // Check for admin auth
 | ||||||
|     let isAuthenticated = await checkAdminAuth(password); |     const isAuthenticated = await checkAdminAuth(password); | ||||||
|     if (!isAuthenticated) { |     if (!isAuthenticated) { | ||||||
|       return NextResponse.json( |       return NextResponse.json( | ||||||
|         { error: 'Unauthorized' }, |         { error: 'Unauthorized' }, | ||||||
|  | |||||||
| @ -77,7 +77,7 @@ async function verifyAdminToken(): Promise<boolean> { | |||||||
| 
 | 
 | ||||||
| export async function checkAdminAuth(password?: string): Promise<boolean> { | export async function checkAdminAuth(password?: string): Promise<boolean> { | ||||||
|   // Get admin password from environment variable or use default for development
 |   // Get admin password from environment variable or use default for development
 | ||||||
|   let isAuthenticated = await verifyAdminToken(); |   const isAuthenticated = await verifyAdminToken(); | ||||||
|   if (isAuthenticated) return true; |   if (isAuthenticated) return true; | ||||||
|   if (password) { |   if (password) { | ||||||
|     const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || 'schafwaschener-segelverein-admin'; |     const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || 'schafwaschener-segelverein-admin'; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user