From 3b26fe6056adc2776f592b48e3ffd6c878cdb4f3 Mon Sep 17 00:00:00 2001 From: David Lyon <5115845+dauglyon@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:29:35 -0700 Subject: [PATCH 1/4] Add MFA status indicators to login sessions - Add mfaAuthenticated field to token type definitions - Create MfaStatusIndicator component with color-coded icons - Add MFA Status column to both Current and Other login session tables - Display green check (MFA used), red check (single factor), or grey check (not supported) - Include tooltips for each status type - Only show indicators for Login token types --- src/common/api/authService.ts | 2 ++ src/features/account/LogInSessions.tsx | 30 ++++++++++++++++++++++++++ src/features/auth/authSlice.ts | 1 + 3 files changed, 33 insertions(+) diff --git a/src/common/api/authService.ts b/src/common/api/authService.ts index 5e9b7573..cfc0a8cc 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; + mfaAuthenticated: boolean | null; } interface AuthParams { @@ -158,6 +159,7 @@ interface AuthResults { device: string; ip: string; name?: string; + mfaAuthenticated: boolean | null; }[]; user: string; revokeallurl: string; diff --git a/src/features/account/LogInSessions.tsx b/src/features/account/LogInSessions.tsx index 330d6954..626c2aff 100644 --- a/src/features/account/LogInSessions.tsx +++ b/src/features/account/LogInSessions.tsx @@ -19,6 +19,28 @@ import { Loader } from '../../common/components'; import { useAppSelector } from '../../common/hooks'; import { useLogout } from '../login/LogIn'; +const MfaStatusIndicator: FC<{ mfaAuthenticated: boolean | null }> = ({ mfaAuthenticated }) => { + if (mfaAuthenticated === true) { + return ( + + + + ); + } else if (mfaAuthenticated === false) { + return ( + + + + ); + } else { + return ( + + + + ); + } +}; + /** * Content for the Log In Sessions tab in the Account page */ @@ -68,6 +90,7 @@ export const LogInSessions: FC = () => { Browser Operating System IP Address + MFA Status Action @@ -86,6 +109,9 @@ export const LogInSessions: FC = () => { {currentToken?.os} {currentToken?.osver} {currentToken?.ip} + + + @@ -105,6 +131,7 @@ export const LogInSessions: FC = () => { Browser Operating System IP Address + MFA Status Action @@ -124,6 +151,9 @@ export const LogInSessions: FC = () => { {otherToken.os} {otherToken.osver} {otherToken.ip} + + + diff --git a/src/features/auth/authSlice.ts b/src/features/auth/authSlice.ts index 0a546e6b..10cb998e 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; + mfaAuthenticated: boolean | null; } interface AuthState { From 0f85435d12c8fae8de3772d4b2414174c134bc04 Mon Sep 17 00:00:00 2001 From: David Lyon <5115845+dauglyon@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:44:02 -0700 Subject: [PATCH 2/4] fix lint --- src/features/account/LogInSessions.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/features/account/LogInSessions.tsx b/src/features/account/LogInSessions.tsx index 626c2aff..c5193f2b 100644 --- a/src/features/account/LogInSessions.tsx +++ b/src/features/account/LogInSessions.tsx @@ -19,7 +19,9 @@ import { Loader } from '../../common/components'; import { useAppSelector } from '../../common/hooks'; import { useLogout } from '../login/LogIn'; -const MfaStatusIndicator: FC<{ mfaAuthenticated: boolean | null }> = ({ mfaAuthenticated }) => { +const MfaStatusIndicator: FC<{ mfaAuthenticated: boolean | null }> = ({ + mfaAuthenticated, +}) => { if (mfaAuthenticated === true) { return ( @@ -110,7 +112,9 @@ export const LogInSessions: FC = () => { {currentToken?.ip} - + @@ -152,7 +156,9 @@ export const LogInSessions: FC = () => { {otherToken.ip} - + From da57e15461d3ea3a9de628104691a3c8c86cf42d Mon Sep 17 00:00:00 2001 From: David Lyon <5115845+dauglyon@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:34:55 -0700 Subject: [PATCH 3/4] Update MFA field from boolean to tri-state enum for auth2 compatibility --- src/common/api/authService.ts | 4 ++-- src/features/account/LogInSessions.tsx | 22 +++++++++++----------- src/features/auth/authSlice.ts | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/common/api/authService.ts b/src/common/api/authService.ts index cfc0a8cc..9b441398 100644 --- a/src/common/api/authService.ts +++ b/src/common/api/authService.ts @@ -25,7 +25,7 @@ interface TokenResponse { type: string; user: string; cachefor: number; - mfaAuthenticated: boolean | null; + mfa: 'USED' | 'NOT_USED' | 'UNKNOWN'; } interface AuthParams { @@ -159,7 +159,7 @@ interface AuthResults { device: string; ip: string; name?: string; - mfaAuthenticated: boolean | null; + mfa: 'USED' | 'NOT_USED' | 'UNKNOWN'; }[]; user: string; revokeallurl: string; diff --git a/src/features/account/LogInSessions.tsx b/src/features/account/LogInSessions.tsx index c5193f2b..cba19822 100644 --- a/src/features/account/LogInSessions.tsx +++ b/src/features/account/LogInSessions.tsx @@ -19,16 +19,16 @@ import { Loader } from '../../common/components'; import { useAppSelector } from '../../common/hooks'; import { useLogout } from '../login/LogIn'; -const MfaStatusIndicator: FC<{ mfaAuthenticated: boolean | null }> = ({ - mfaAuthenticated, +const MfaStatusIndicator: FC<{ mfa: 'USED' | 'NOT_USED' | 'UNKNOWN' }> = ({ + mfa, }) => { - if (mfaAuthenticated === true) { + if (mfa === 'USED') { return ( ); - } else if (mfaAuthenticated === false) { + } else if (mfa === 'NOT_USED') { return ( @@ -36,7 +36,7 @@ const MfaStatusIndicator: FC<{ mfaAuthenticated: boolean | null }> = ({ ); } else { return ( - + ); @@ -112,9 +112,9 @@ export const LogInSessions: FC = () => { {currentToken?.ip} - + {currentToken?.mfa && ( + + )} @@ -156,9 +156,9 @@ export const LogInSessions: FC = () => { {otherToken.ip} - + {otherToken.mfa && ( + + )} diff --git a/src/features/auth/authSlice.ts b/src/features/auth/authSlice.ts index 10cb998e..a2df724e 100644 --- a/src/features/auth/authSlice.ts +++ b/src/features/auth/authSlice.ts @@ -11,7 +11,7 @@ export interface TokenInfo { type: string; user: string; cachefor: number; - mfaAuthenticated: boolean | null; + mfa: 'USED' | 'NOT_USED' | 'UNKNOWN'; } interface AuthState { From 7b2acff54e5115e231fe8d982de4444768bc667c Mon Sep 17 00:00:00 2001 From: David Lyon Date: Tue, 9 Sep 2025 09:02:11 -0700 Subject: [PATCH 4/4] fix MFA inidcators/tooltips --- src/features/account/LogInSessions.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/features/account/LogInSessions.tsx b/src/features/account/LogInSessions.tsx index cba19822..ccaf2af1 100644 --- a/src/features/account/LogInSessions.tsx +++ b/src/features/account/LogInSessions.tsx @@ -25,19 +25,25 @@ const MfaStatusIndicator: FC<{ mfa: 'USED' | 'NOT_USED' | 'UNKNOWN' }> = ({ if (mfa === 'USED') { return ( - + + + ); } else if (mfa === 'NOT_USED') { return ( - + + + ); } else { return ( - + + + ); } @@ -92,7 +98,7 @@ export const LogInSessions: FC = () => { Browser Operating System IP Address - MFA Status + MFA Action @@ -135,7 +141,7 @@ export const LogInSessions: FC = () => { Browser Operating System IP Address - MFA Status + MFA Action