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> {
2806
2806
)
2807
2807
. await ;
2808
2808
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
+ }
2810
2824
} ,
2811
2825
AuthenticationToken :: PlaintextUser ( token) => {
2812
2826
// For plaintext authentication, create a PlaintextUser identity
You can’t perform that action at this time.
0 commit comments