Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
chore: log token on jwt decode failure (#1735)
Will Hutchinson6b563e745739
diff --git a/rust/cloud-storage/authentication_service/src/api/jwt/refresh.rs b/rust/cloud-storage/authentication_service/src/api/jwt/refresh.rsindex c4429f642d..41302f58d0 100644--- a/rust/cloud-storage/authentication_service/src/api/jwt/refresh.rs+++ b/rust/cloud-storage/authentication_service/src/api/jwt/refresh.rs@@ -81,7 +81,7 @@ pub async fn handler(// We only want to refresh the token if it's expiredMacroAuthError::JwtExpired => {}_ => {- tracing::error!(error=?e, "unable to decode jwt");+ tracing::error!(error=?e, token=?token_context.access_token, "unable to decode jwt");return Err(RefreshError::Unauthorized);}},diff --git a/rust/cloud-storage/authentication_service/src/api/middleware/extract_tokens.rs b/rust/cloud-storage/authentication_service/src/api/middleware/extract_tokens.rsindex 8f67ed4dfe..c9a0a96daa 100644--- a/rust/cloud-storage/authentication_service/src/api/middleware/extract_tokens.rs+++ b/rust/cloud-storage/authentication_service/src/api/middleware/extract_tokens.rs@@ -7,7 +7,7 @@ use axum::{};use macro_auth::error::MacroAuthError;-// Extracts the access token and refresh token and inserts into TokenContext+/// Extracts the access token and refresh token and inserts into TokenContextpub(in crate::api) async fn handler(mut req: Request, next: Next) -> Result<Response, Response> {let headers = req.headers();let access_token = match macro_auth::headers::extract_access_token_from_request_headers(headers)diff --git a/rust/cloud-storage/macro_auth/src/headers.rs b/rust/cloud-storage/macro_auth/src/headers.rsindex c82705f84b..fe44aaac52 100644--- a/rust/cloud-storage/macro_auth/src/headers.rs+++ b/rust/cloud-storage/macro_auth/src/headers.rs@@ -6,6 +6,7 @@ use crate::{error::MacroAuthError,};+/// Extracts the access token from request headerspub fn extract_access_token_from_request_headers(headers: &axum::http::HeaderMap,) -> Result<String, MacroAuthError> {@@ -56,6 +57,7 @@ pub fn extract_access_token_from_request_headers(Err(MacroAuthError::NoAccessTokenProvided)}+/// Extracts refresh token from request headerspub fn extract_refresh_token_from_request_headers(headers: &axum::http::HeaderMap,) -> Result<String, MacroAuthError> {