File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2806,7 +2806,21 @@ impl<RT: Runtime> Application<RT> {
28062806 )
28072807 . await ;
28082808
2809- Identity :: user ( identity_result?)
2809+ match identity_result {
2810+ Ok ( user_identity) => Identity :: user ( user_identity) ,
2811+ Err ( error) => {
2812+ // For authentication errors, store them in Identity::Unknown so that
2813+ // getUserIdentityDebug can access and log them instead of failing the
2814+ // request
2815+ if let Some ( error_metadata) = error. downcast_ref :: < ErrorMetadata > ( ) {
2816+ if matches ! ( error_metadata. code, errors:: ErrorCode :: Unauthenticated ) {
2817+ return Ok ( Identity :: Unknown ( Some ( error_metadata. clone ( ) ) ) ) ;
2818+ }
2819+ }
2820+ // For other errors (non-authentication), propagate them normally
2821+ return Err ( error) ;
2822+ } ,
2823+ }
28102824 } ,
28112825 AuthenticationToken :: PlaintextUser ( token) => {
28122826 // For plaintext authentication, create a PlaintextUser identity
You can’t perform that action at this time.
0 commit comments