diff --git a/frontend/src/components/auth/LockScreen.tsx b/frontend/src/components/auth/LockScreen.tsx index 24b5b9e..0739ed5 100644 --- a/frontend/src/components/auth/LockScreen.tsx +++ b/frontend/src/components/auth/LockScreen.tsx @@ -155,11 +155,10 @@ export default function LockScreen() { // mfaSetupRequired / mfaRequired handled by hook state → activeMode switches automatically } catch (error: any) { const status = error?.response?.status; - if (status === 423) { - setLoginError(error.response.data?.detail || 'Account locked. Try again later.'); - } else if (status === 403) { + if (status === 403) { setLoginError(error.response.data?.detail || 'Account is disabled. Contact an administrator.'); } else { + // 401 covers both wrong password and account lockout (backend embeds detail string) setLoginError(getErrorMessage(error, 'Invalid username or password')); } } @@ -519,18 +518,28 @@ export default function LockScreen() { - {loginError && ( -
-
- )} + {loginError && (() => { + const isLockWarning = + loginError.includes('remaining') || loginError.includes('temporarily locked'); + return ( +
+ {isLockWarning + ?
+ ); + })()}