From b31e2f9063f57e9aebcf2dab846e3bd7fba1fbb2 Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Thu, 17 Oct 2024 21:56:02 -0600 Subject: [PATCH 1/4] link added for reporting vulnerability --- keycloak/themes/uid2-theme/login/resources/css/login.css | 4 ++++ keycloak/themes/uid2-theme/login/template.ftl | 6 +++++- src/web/App.tsx | 5 +++-- src/web/contexts/ParticipantProvider.tsx | 4 +++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/keycloak/themes/uid2-theme/login/resources/css/login.css b/keycloak/themes/uid2-theme/login/resources/css/login.css index 9e11c7b89..144d22616 100644 --- a/keycloak/themes/uid2-theme/login/resources/css/login.css +++ b/keycloak/themes/uid2-theme/login/resources/css/login.css @@ -321,4 +321,8 @@ div.kc-logo-text { background-color: var(--pf-c-button--disabled--BackgroundColor); } +#report-vulnerability { + color: gray; +} + /* End Recovery codes */ diff --git a/keycloak/themes/uid2-theme/login/template.ftl b/keycloak/themes/uid2-theme/login/template.ftl index d4423050b..ff0a9eb6a 100644 --- a/keycloak/themes/uid2-theme/login/template.ftl +++ b/keycloak/themes/uid2-theme/login/template.ftl @@ -144,10 +144,14 @@
<#nested "info"> +
-
+ +
+ Report a Vulnerability + diff --git a/src/web/App.tsx b/src/web/App.tsx index 10e019170..14a12196b 100644 --- a/src/web/App.tsx +++ b/src/web/App.tsx @@ -1,6 +1,6 @@ import { useKeycloak } from '@react-keycloak/web'; import { StrictMode, useCallback, useContext, useRef } from 'react'; -import { Outlet } from 'react-router-dom'; +import { Outlet, useLocation } from 'react-router-dom'; import { EnvironmentBanner } from './components/Core/Banner/EnvironmentBanner'; import { ErrorView } from './components/Core/ErrorView/ErrorView'; @@ -24,11 +24,12 @@ function AppContent() { const { LoggedInUser } = useContext(CurrentUserContext); const { participant } = useContext(ParticipantContext); const isLocalDev = process.env.NODE_ENV === 'development'; + const location = useLocation(); if (LoggedInUser?.user?.participants!.length === 0) { return ; } - if (LoggedInUser && !participant) { + if (location.pathname !== '/account/create' && LoggedInUser && !participant) { return ; } diff --git a/src/web/contexts/ParticipantProvider.tsx b/src/web/contexts/ParticipantProvider.tsx index 9640bc94a..6013b5c34 100644 --- a/src/web/contexts/ParticipantProvider.tsx +++ b/src/web/contexts/ParticipantProvider.tsx @@ -53,7 +53,9 @@ function ParticipantProvider({ children }: Readonly<{ children: ReactNode }>) { ? await GetSelectedParticipant(currentParticipantId) : await GetUsersDefaultParticipant(); setParticipant(p); - localStorage.setItem('lastSelectedParticipantId', p.id.toString()); + if (p.status === ParticipantStatus.Approved) { + localStorage.setItem('lastSelectedParticipantId', p.id.toString()); + } } } catch (e: unknown) { if (e instanceof ApiError) throwError(e); From 62b7724ae6141c795b3a9c90fb21f545e9fa244d Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Thu, 17 Oct 2024 21:59:20 -0600 Subject: [PATCH 2/4] fixed spacing --- keycloak/themes/uid2-theme/login/template.ftl | 2 -- src/web/contexts/ParticipantProvider.tsx | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/keycloak/themes/uid2-theme/login/template.ftl b/keycloak/themes/uid2-theme/login/template.ftl index ff0a9eb6a..f78337ed5 100644 --- a/keycloak/themes/uid2-theme/login/template.ftl +++ b/keycloak/themes/uid2-theme/login/template.ftl @@ -144,14 +144,12 @@
<#nested "info"> -

Report a Vulnerability - diff --git a/src/web/contexts/ParticipantProvider.tsx b/src/web/contexts/ParticipantProvider.tsx index 6013b5c34..9640bc94a 100644 --- a/src/web/contexts/ParticipantProvider.tsx +++ b/src/web/contexts/ParticipantProvider.tsx @@ -53,9 +53,7 @@ function ParticipantProvider({ children }: Readonly<{ children: ReactNode }>) { ? await GetSelectedParticipant(currentParticipantId) : await GetUsersDefaultParticipant(); setParticipant(p); - if (p.status === ParticipantStatus.Approved) { - localStorage.setItem('lastSelectedParticipantId', p.id.toString()); - } + localStorage.setItem('lastSelectedParticipantId', p.id.toString()); } } catch (e: unknown) { if (e instanceof ApiError) throwError(e); From bea990376bc15063696247e6767991172b6d2f53 Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Thu, 17 Oct 2024 22:00:07 -0600 Subject: [PATCH 3/4] fixed spacing --- keycloak/themes/uid2-theme/login/template.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keycloak/themes/uid2-theme/login/template.ftl b/keycloak/themes/uid2-theme/login/template.ftl index f78337ed5..5a9eb74db 100644 --- a/keycloak/themes/uid2-theme/login/template.ftl +++ b/keycloak/themes/uid2-theme/login/template.ftl @@ -145,7 +145,7 @@
<#nested "info">
- +
Report a Vulnerability From d153361e786a9152409f93c9f9c8a88619f61e47 Mon Sep 17 00:00:00 2001 From: Ashley Smith Date: Thu, 17 Oct 2024 23:03:27 -0600 Subject: [PATCH 4/4] switched from id to class --- keycloak/themes/uid2-theme/login/resources/css/login.css | 4 ++-- keycloak/themes/uid2-theme/login/template.ftl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keycloak/themes/uid2-theme/login/resources/css/login.css b/keycloak/themes/uid2-theme/login/resources/css/login.css index 144d22616..e9bdc3fb2 100644 --- a/keycloak/themes/uid2-theme/login/resources/css/login.css +++ b/keycloak/themes/uid2-theme/login/resources/css/login.css @@ -321,8 +321,8 @@ div.kc-logo-text { background-color: var(--pf-c-button--disabled--BackgroundColor); } -#report-vulnerability { - color: gray; +.report-vulnerability { + color: gray !important; } /* End Recovery codes */ diff --git a/keycloak/themes/uid2-theme/login/template.ftl b/keycloak/themes/uid2-theme/login/template.ftl index 5a9eb74db..e756e772a 100644 --- a/keycloak/themes/uid2-theme/login/template.ftl +++ b/keycloak/themes/uid2-theme/login/template.ftl @@ -148,7 +148,7 @@
- Report a Vulnerability + Report a Vulnerability