Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/public/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ const AppRouter = () => {
<Router history={history} basename={window.SERVER_FLAGS.basePath}>
<CompatRouter>
<Routes>
<Route path={LOGIN_ERROR_PATH} component={AuthenticationErrorPage} />
<Route path={LOGIN_ERROR_PATH} element={<AuthenticationErrorPage />} />
{standaloneRouteExtensions.map((e) => (
<Route
key={e.uid}
Expand Down
41 changes: 28 additions & 13 deletions frontend/public/components/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import {
StackItem,
EmptyStateHeader,
EmptyStateActions,
EmptyStateFooter,
Icon,
Button,
Title,
} from '@patternfly/react-core';
import { ExclamationCircleIcon } from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
Expand Down Expand Up @@ -99,20 +101,28 @@ const LoginErrorMessage: React.FC = () => {
case 'login_state_error':
return t('public~There was an error generating login state.');
case 'cookie_error':
return t('public~There was an error setting login state cookie');
case 'missing_code':
return t('public~Auth code is missing in query param.');
case 'missing_state':
return t('public~There was an error parsing your state cookie');
case 'invalid_code':
return t('public~There was an error logging you in. Please log out and try again.');
case 'invalid_state':
return t('public~There was an error verifying your session. Please log out and try again.');
return t('public~There was an error setting login state cookie.');
case 'logout_error':
return t('public~There was an error logging you out. Please try again.');
case 'auth':
// When the error type is set as auth
switch (error) {
case 'missing_state':
return t('public~There was an error parsing your state cookie.');
case 'invalid_state':
return t(
'public~There was an error verifying your session. Please log out and try again.',
);
case 'missing_code':
return t('public~Auth code is missing in query param.');
case 'invalid_code':
return t('public~There was an error logging you in. Please log out and try again.');
default:
return t('public~There was an authentication error. Please log out and try again.');
}
default:
return (
<Trans>
<Trans ns="public">
There was an authentication error with the system:
<CodeBlock>
<CodeBlockCode>{error}</CodeBlockCode>
Expand All @@ -125,6 +135,7 @@ const LoginErrorMessage: React.FC = () => {
export const AuthenticationErrorPage: React.FC = () => {
const { t } = useTranslation();
const title = t('public~Authentication error');

return (
<>
<Helmet>
Expand All @@ -143,9 +154,13 @@ export const AuthenticationErrorPage: React.FC = () => {
</StackItem>
</Stack>
</EmptyStateBody>
<EmptyStateActions>
<a href="/logout">{t('public~Try again')}</a>
</EmptyStateActions>
<EmptyStateFooter>
<EmptyStateActions>
<Button component="a" variant="primary" href="/">
{t('public~Try again')}
</Button>
</EmptyStateActions>
</EmptyStateFooter>
</EmptyState>
</>
);
Expand Down
9 changes: 5 additions & 4 deletions frontend/public/locales/en/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,13 @@
"There was a problem processing the request. Please try again.": "There was a problem processing the request. Please try again.",
"There was an error generating OAuth client from OIDC client.": "There was an error generating OAuth client from OIDC client.",
"There was an error generating login state.": "There was an error generating login state.",
"There was an error setting login state cookie": "There was an error setting login state cookie",
"There was an error setting login state cookie.": "There was an error setting login state cookie.",
"There was an error logging you out. Please try again.": "There was an error logging you out. Please try again.",
"There was an error parsing your state cookie.": "There was an error parsing your state cookie.",
"There was an error verifying your session. Please log out and try again.": "There was an error verifying your session. Please log out and try again.",
"Auth code is missing in query param.": "Auth code is missing in query param.",
"There was an error parsing your state cookie": "There was an error parsing your state cookie",
"There was an error logging you in. Please log out and try again.": "There was an error logging you in. Please log out and try again.",
"There was an error verifying your session. Please log out and try again.": "There was an error verifying your session. Please log out and try again.",
"There was an error logging you out. Please try again.": "There was an error logging you out. Please try again.",
"There was an authentication error. Please log out and try again.": "There was an authentication error. Please log out and try again.",
"There was an authentication error with the system:<1><0>{error}</0></1>": "There was an authentication error with the system:<1><0>{error}</0></1>",
"Authentication error": "Authentication error",
"Try again": "Try again",
Expand Down