Spaces:
Paused
Paused
icebear0828 Claude Opus 4.6 commited on
Commit ·
1f63c38
1
Parent(s): 717e975
fix: proxy_api_key from config not used in frontend or auth validation
Browse files/auth/status now returns config.server.proxy_api_key when set instead
of per-account random hash. validateProxyApiKey also accepts the
configured key.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- src/auth/account-pool.ts +2 -0
- src/routes/auth.ts +2 -1
src/auth/account-pool.ts
CHANGED
|
@@ -331,6 +331,8 @@ export class AccountPool {
|
|
| 331 |
}
|
| 332 |
|
| 333 |
validateProxyApiKey(key: string): boolean {
|
|
|
|
|
|
|
| 334 |
for (const entry of this.accounts.values()) {
|
| 335 |
if (entry.proxyApiKey === key) return true;
|
| 336 |
}
|
|
|
|
| 331 |
}
|
| 332 |
|
| 333 |
validateProxyApiKey(key: string): boolean {
|
| 334 |
+
const configKey = getConfig().server.proxy_api_key;
|
| 335 |
+
if (configKey && key === configKey) return true;
|
| 336 |
for (const entry of this.accounts.values()) {
|
| 337 |
if (entry.proxyApiKey === key) return true;
|
| 338 |
}
|
src/routes/auth.ts
CHANGED
|
@@ -23,7 +23,8 @@ export function createAuthRoutes(
|
|
| 23 |
app.get("/auth/status", (c) => {
|
| 24 |
const authenticated = pool.isAuthenticated();
|
| 25 |
const userInfo = pool.getUserInfo();
|
| 26 |
-
const
|
|
|
|
| 27 |
const summary = pool.getPoolSummary();
|
| 28 |
return c.json({
|
| 29 |
authenticated,
|
|
|
|
| 23 |
app.get("/auth/status", (c) => {
|
| 24 |
const authenticated = pool.isAuthenticated();
|
| 25 |
const userInfo = pool.getUserInfo();
|
| 26 |
+
const config = getConfig();
|
| 27 |
+
const proxyApiKey = config.server.proxy_api_key ?? pool.getProxyApiKey();
|
| 28 |
const summary = pool.getPoolSummary();
|
| 29 |
return c.json({
|
| 30 |
authenticated,
|