File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
crates/handlers/src/compat Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -508,19 +508,16 @@ async fn token_login(
508508 ) ;
509509 return Err ( RouteError :: InvalidLoginToken ) ;
510510 } ;
511+ if browser_session. user . locked_at . is_some ( ) {
512+ return Err ( RouteError :: UserLocked ) ;
513+ }
511514 if !browser_session. active ( ) || !browser_session. user . is_valid ( ) {
512515 tracing:: info!(
513516 compat_sso_login. id = %login. id,
514517 browser_session. id = %browser_session_id,
515518 "Attempt to exchange login token but browser session is not active"
516519 ) ;
517- return Err (
518- if browser_session. finished_at . is_none ( ) && browser_session. user . locked_at . is_some ( ) {
519- RouteError :: UserLocked
520- } else {
521- RouteError :: InvalidLoginToken
522- } ,
523- ) ;
520+ return Err ( RouteError :: InvalidLoginToken ) ;
524521 }
525522
526523 // We're about to create a device, let's explicitly acquire a lock, so that
You can’t perform that action at this time.
0 commit comments