added more support for supabase-js

This commit is contained in:
2026-03-12 10:18:52 +02:00
parent c0792f2e1d
commit 6708cf28a7
62 changed files with 6563 additions and 526 deletions

View File

@@ -44,11 +44,18 @@ pub async fn auth_middleware(
if path.contains("/authorize") || path.contains("/callback") {
return Ok(next.run(req).await);
}
// Allow public Signed URL access (GET only)
if path.contains("/object/sign/") && req.method() == axum::http::Method::GET {
return Ok(next.run(req).await);
}
// Determine the secret to use
let jwt_secret = if let Some(ctx) = &project_ctx {
tracing::info!("Using project-specific JWT secret: '{}'", ctx.jwt_secret);
ctx.jwt_secret.clone()
} else {
tracing::warn!("ProjectContext not found! Using global JWT secret: '{}'", state.config.jwt_secret);
state.config.jwt_secret.clone()
};
@@ -98,8 +105,9 @@ pub async fn auth_middleware(
req.extensions_mut().insert(ctx);
return Ok(next.run(req).await);
}
Err(_) => {
Err(e) => {
// Invalid token
tracing::error!("Token validation failed: {}", e);
return Err(StatusCode::UNAUTHORIZED);
}
}