diff --git a/frontend/src/component/admin/users/UsersList/loadingData.ts b/frontend/src/component/admin/users/UsersList/loadingData.ts index 120a0105aa..a197369849 100644 --- a/frontend/src/component/admin/users/UsersList/loadingData.ts +++ b/frontend/src/component/admin/users/UsersList/loadingData.ts @@ -14,6 +14,7 @@ const loadingData: IUser[] = [ createdAt: '2021-04-21T12:09:55.923Z', rootRole: 1, inviteLink: '', + isAPI: false, }, { id: 16, @@ -27,6 +28,7 @@ const loadingData: IUser[] = [ createdAt: '2021-04-21T15:54:02.765Z', rootRole: 2, inviteLink: '', + isAPI: false, }, { id: 3, @@ -40,6 +42,7 @@ const loadingData: IUser[] = [ createdAt: '2021-04-21T12:33:17.712Z', rootRole: 1, inviteLink: '', + isAPI: false, }, { id: 4, @@ -53,6 +56,7 @@ const loadingData: IUser[] = [ createdAt: '2021-04-21T15:54:02.765Z', rootRole: 2, inviteLink: '', + isAPI: false, }, { id: 5, @@ -66,6 +70,7 @@ const loadingData: IUser[] = [ createdAt: '2021-04-21T12:33:17.712Z', rootRole: 1, inviteLink: '', + isAPI: false, }, ]; diff --git a/frontend/src/component/splash/SplashPageRedirect/SplashPageRedirect.tsx b/frontend/src/component/splash/SplashPageRedirect/SplashPageRedirect.tsx index b2e3951f61..71ecf37c8a 100644 --- a/frontend/src/component/splash/SplashPageRedirect/SplashPageRedirect.tsx +++ b/frontend/src/component/splash/SplashPageRedirect/SplashPageRedirect.tsx @@ -5,13 +5,15 @@ import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import { IFlags } from 'interfaces/uiConfig'; import { IAuthSplash } from 'hooks/api/getters/useAuth/useAuthEndpoint'; import { activeSplashIds, SplashId } from 'component/splash/splash'; +import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser'; export const SplashPageRedirect = () => { const { pathname } = useLocation(); + const { user } = useAuthUser(); const { splash } = useAuthSplash(); const { uiConfig, loading } = useUiConfig(); - if (!splash || !uiConfig || loading) { + if (!user || !splash || !uiConfig || loading) { // Wait for everything to load. return null; } @@ -21,6 +23,12 @@ export const SplashPageRedirect = () => { return null; } + // Read-only API users should never see splash screens + // since they don't have access to mark them as seen. + if (user.isAPI) { + return null; + } + // Find the splash page to show (if any). const showSplashId = activeSplashIds.find(splashId => { return ( diff --git a/frontend/src/interfaces/user.ts b/frontend/src/interfaces/user.ts index 3c19e970bd..4ccb3ad1e8 100644 --- a/frontend/src/interfaces/user.ts +++ b/frontend/src/interfaces/user.ts @@ -10,6 +10,7 @@ export interface IUser { rootRole: number; seenAt: string | null; username?: string; + isAPI: boolean; } export interface IPermission {