diff --git a/i18n/en.pot b/i18n/en.pot index 917a76b..e82b37a 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-03-13T14:28:23.404Z\n" -"PO-Revision-Date: 2024-03-13T14:28:23.404Z\n" +"POT-Creation-Date: 2024-03-14T15:15:04.384Z\n" +"PO-Revision-Date: 2024-03-14T15:15:04.384Z\n" msgid "Please confirm that you are not a robot by checking the checkbox." msgstr "Please confirm that you are not a robot by checking the checkbox." @@ -195,3 +195,10 @@ msgstr "Choose new password" msgid "Enter the new password for your account below" msgstr "Enter the new password for your account below" + +msgid "" +"You should shortly be redirected. If you are not redirected, please click " +"button." +msgstr "" +"You should shortly be redirected. If you are not redirected, please click " +"button." diff --git a/src/app.js b/src/app.js index 349d8ca..d9a9584 100644 --- a/src/app.js +++ b/src/app.js @@ -20,6 +20,7 @@ import { CreateAccountPage, PasswordResetRequestPage, PasswordUpdatePage, + SafeModePage, } from './pages/index.js' import { LoginConfigProvider, useLoginConfig } from './providers/index.js' import i18n from './locales/index.js' // eslint-disable-line @@ -44,6 +45,7 @@ const LoginRoutes = () => { path="/update-password" element={} /> + } /> } /> diff --git a/src/pages/index.js b/src/pages/index.js index 4180cb5..7e97ca0 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -3,3 +3,4 @@ export { default as CreateAccountPage } from './create-account.js' export { default as LoginPage } from './login.js' export { default as PasswordResetRequestPage } from './password-reset-request.js' export { default as PasswordUpdatePage } from './password-update.js' +export { default as SafeModePage } from './safe-mode.js' diff --git a/src/pages/safe-mode.js b/src/pages/safe-mode.js new file mode 100644 index 0000000..6cce9ef --- /dev/null +++ b/src/pages/safe-mode.js @@ -0,0 +1,33 @@ +import i18n from '@dhis2/d2-i18n' +import { Button } from '@dhis2/ui' +import React, { useEffect } from 'react' +import { useLoginConfig } from '../providers/index.js' + +const SAFE_MODE_ENDPOINT = 'dhis-web-commons/security/login.action' + +const SafeModePage = () => { + const { baseUrl, uiLocale } = useLoginConfig() + const safeURL = `${baseUrl}/${SAFE_MODE_ENDPOINT}` + + useEffect(() => { + window.location.href = `${baseUrl}/${SAFE_MODE_ENDPOINT}` + }, [baseUrl]) + + return ( + <> +

+ {i18n.t( + 'You should shortly be redirected. If you are not redirected, please click redirect button.', + { lng: uiLocale } + )} +

+
+ + + +
+ + ) +} + +export default SafeModePage