Spaces:
Running
Running
Commit ·
ad5892d
1
Parent(s): ca59934
fix: add fallback password for server-side auth validation
Browse filesClient-side used 'cz-2025' as fallback but server-side getDefaultPassword()
returned undefined when env vars weren't set, causing auth failures after
registration.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- src/lib/auth/session.ts +3 -3
src/lib/auth/session.ts
CHANGED
|
@@ -82,8 +82,8 @@ export function parseBasicAuthHeader(authHeader: string): { username: string; pa
|
|
| 82 |
|
| 83 |
/**
|
| 84 |
* Get the user password from environment
|
| 85 |
-
*
|
| 86 |
*/
|
| 87 |
-
export function getDefaultPassword(): string
|
| 88 |
-
return process.env.BASIC_AUTH_PASSWORD || process.env.NEXT_PUBLIC_DEFAULT_PASSWORD;
|
| 89 |
}
|
|
|
|
| 82 |
|
| 83 |
/**
|
| 84 |
* Get the user password from environment
|
| 85 |
+
* Falls back to 'cz-2025' if not set
|
| 86 |
*/
|
| 87 |
+
export function getDefaultPassword(): string {
|
| 88 |
+
return process.env.BASIC_AUTH_PASSWORD || process.env.NEXT_PUBLIC_DEFAULT_PASSWORD || 'cz-2025';
|
| 89 |
}
|