diff --git a/src/common/api/authService.ts b/src/common/api/authService.ts index 5e9b7573..9b441398 100644 --- a/src/common/api/authService.ts +++ b/src/common/api/authService.ts @@ -25,6 +25,7 @@ interface TokenResponse { type: string; user: string; cachefor: number; + mfa: 'USED' | 'NOT_USED' | 'UNKNOWN'; } interface AuthParams { @@ -158,6 +159,7 @@ interface AuthResults { device: string; ip: string; name?: string; + mfa: 'USED' | 'NOT_USED' | 'UNKNOWN'; }[]; user: string; revokeallurl: string; diff --git a/src/features/account/LogInSessions.tsx b/src/features/account/LogInSessions.tsx index 330d6954..cba19822 100644 --- a/src/features/account/LogInSessions.tsx +++ b/src/features/account/LogInSessions.tsx @@ -19,6 +19,30 @@ import { Loader } from '../../common/components'; import { useAppSelector } from '../../common/hooks'; import { useLogout } from '../login/LogIn'; +const MfaStatusIndicator: FC<{ mfa: 'USED' | 'NOT_USED' | 'UNKNOWN' }> = ({ + mfa, +}) => { + if (mfa === 'USED') { + return ( + + + + ); + } else if (mfa === 'NOT_USED') { + return ( + + + + ); + } else { + return ( + + + + ); + } +}; + /** * Content for the Log In Sessions tab in the Account page */ @@ -68,6 +92,7 @@ export const LogInSessions: FC = () => { Browser Operating System IP Address + MFA Status Action @@ -86,6 +111,11 @@ export const LogInSessions: FC = () => { {currentToken?.os} {currentToken?.osver} {currentToken?.ip} + + {currentToken?.mfa && ( + + )} + @@ -105,6 +135,7 @@ export const LogInSessions: FC = () => { Browser Operating System IP Address + MFA Status Action @@ -124,6 +155,11 @@ export const LogInSessions: FC = () => { {otherToken.os} {otherToken.osver} {otherToken.ip} + + {otherToken.mfa && ( + + )} + diff --git a/src/features/auth/authSlice.ts b/src/features/auth/authSlice.ts index 0a546e6b..a2df724e 100644 --- a/src/features/auth/authSlice.ts +++ b/src/features/auth/authSlice.ts @@ -11,6 +11,7 @@ export interface TokenInfo { type: string; user: string; cachefor: number; + mfa: 'USED' | 'NOT_USED' | 'UNKNOWN'; } interface AuthState {