Major update to chorus.services platform
- Extensive updates to system configuration and deployment - Enhanced documentation and architecture improvements - Updated dependencies and build configurations - Improved service integrations and workflows 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
37
modules/dashboard/middleware.ts
Normal file
37
modules/dashboard/middleware.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
|
||||
export function middleware(request: NextRequest) {
|
||||
// Simple basic auth for dashboard protection
|
||||
const authHeader = request.headers.get('authorization')
|
||||
|
||||
if (!authHeader) {
|
||||
return new NextResponse(null, {
|
||||
status: 401,
|
||||
headers: {
|
||||
'WWW-Authenticate': 'Basic realm="CHORUS Dashboard"',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const credentials = authHeader.split(' ')[1]
|
||||
const [username, password] = Buffer.from(credentials, 'base64').toString().split(':')
|
||||
|
||||
// Simple hardcoded credentials - in production, use environment variables
|
||||
const validUsername = process.env.DASHBOARD_USERNAME || 'chorus'
|
||||
const validPassword = process.env.DASHBOARD_PASSWORD || 'services2025!'
|
||||
|
||||
if (username !== validUsername || password !== validPassword) {
|
||||
return new NextResponse(null, {
|
||||
status: 401,
|
||||
headers: {
|
||||
'WWW-Authenticate': 'Basic realm="CHORUS Dashboard"',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
return NextResponse.next()
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'],
|
||||
}
|
||||
Reference in New Issue
Block a user