fix: persist runtime proxy token

This commit is contained in:
boos
2026-06-06 17:11:51 +08:00
parent b3eb86d5ea
commit f026582008
17 changed files with 276 additions and 27 deletions
+2 -1
View File
@@ -49,8 +49,9 @@ async fn check_auth(state: &AppState, headers: &HeaderMap) -> Result<(), AppErro
// Downstream API key
if auth.starts_with("sk-") {
let proxy_token = state.runtime_proxy_token();
let result =
authorize_downstream_token(auth, &state.db, Some(&state.config.auth.proxy_token))
authorize_downstream_token(auth, &state.db, Some(&proxy_token))
.await
.map_err(AppError::Unauthorized)?;