From a599eddca6aadecd3d5f6e589804c1af79617f49 Mon Sep 17 00:00:00 2001 From: Anton Tranelis <31516529+antontranelis@users.noreply.github.com> Date: Tue, 26 Aug 2025 14:43:31 +0200 Subject: [PATCH] feat(lib): add optional request password button to login page (#334) * add optional request password button to login page * fix linting * fix linting * added field to backend config --- app/src/App.tsx | 10 ++++- .../fields/maps/show_request_password.json | 45 +++++++++++++++++++ backend/directus-config/specs/item.graphql | 6 +++ backend/directus-config/specs/openapi.json | 4 ++ backend/directus-config/specs/system.graphql | 4 ++ lib/src/Components/Auth/LoginPage.tsx | 23 +++++++--- .../Components/Auth/RequestPasswordPage.tsx | 2 +- lib/src/types/UtopiaMapProps.d.ts | 1 + 8 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 backend/directus-config/snapshot/fields/maps/show_request_password.json diff --git a/app/src/App.tsx b/app/src/App.tsx index 9156f062..124b9723 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -168,7 +168,15 @@ function App() { }> } /> - } /> + + } + /> } /> ('') const [password, setPassword] = useState('') @@ -106,11 +107,13 @@ export function LoginPage({ inviteApi }: Props) { className='tw:input tw:input-bordered tw:w-full tw:max-w-xs' />
- - - Forgot Password? - - + {!showRequestPassword && ( + + + Forgot Password? + + + )}
+ {showRequestPassword && ( + <> +
OR
+ + + + + )}
) diff --git a/lib/src/Components/Auth/RequestPasswordPage.tsx b/lib/src/Components/Auth/RequestPasswordPage.tsx index 0f15acd5..dcfb416f 100644 --- a/lib/src/Components/Auth/RequestPasswordPage.tsx +++ b/lib/src/Components/Auth/RequestPasswordPage.tsx @@ -37,7 +37,7 @@ export function RequestPasswordPage({ resetUrl }: { resetUrl: string }) { return ( -

Reset Password

+

Request Password