Skip to content
Merged
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
39 changes: 20 additions & 19 deletions frontend/public/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ const App = (props) => {
}
};

const { productName } = getBrandingDetails();

const isNotificationDrawerExpanded = useSelector(
(state) => !!state.UI.getIn(['notifications', 'isExpanded']),
);
Expand All @@ -223,8 +221,7 @@ const App = (props) => {
};

const content = (
<HelmetProvider>
<Helmet titleTemplate={`%s · ${productName}`} defaultTitle={productName} />
<>
<ConsoleNotifier location="BannerTop" />
<QuickStartDrawer>
<Flex
Expand Down Expand Up @@ -279,7 +276,7 @@ const App = (props) => {
</QuickStartDrawer>
<ConsoleNotifier location="BannerBottom" />
<FeatureFlagExtensionLoader />
</HelmetProvider>
</>
);

return (
Expand Down Expand Up @@ -324,7 +321,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 Expand Up @@ -606,6 +603,7 @@ const initApiDiscovery = (storeInstance) => {
};

graphQLReady.onReady(() => {
const { productName } = getBrandingDetails();
store.dispatch(detectFeatures());

// Global timer to ensure all <Timestamp> components update in sync
Expand Down Expand Up @@ -660,19 +658,22 @@ graphQLReady.onReady(() => {
<React.Suspense fallback={<LoadingBox />}>
<Provider store={store}>
<ThemeProvider>
<AppInitSDK
configurations={{
appFetch: appInternalFetch,
apiDiscovery: initApiDiscovery,
initPlugins,
}}
>
<ToastProvider>
<PollConsoleUpdates />
<AdmissionWebhookWarningNotifications />
<AppRouter />
</ToastProvider>
</AppInitSDK>
<HelmetProvider>
<Helmet titleTemplate={`%s · ${productName}`} defaultTitle={productName} />
<AppInitSDK
configurations={{
appFetch: appInternalFetch,
apiDiscovery: initApiDiscovery,
initPlugins,
}}
>
<ToastProvider>
<PollConsoleUpdates />
<AdmissionWebhookWarningNotifications />
<AppRouter />
</ToastProvider>
</AppInitSDK>
</HelmetProvider>
</ThemeProvider>
</Provider>
</React.Suspense>,
Expand Down
31 changes: 20 additions & 11 deletions frontend/public/components/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,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 @@ -122,6 +130,7 @@ const LoginErrorMessage: React.FC = () => {
export const AuthenticationErrorPage: React.FC = () => {
const { t } = useTranslation();
const title = t('public~Authentication error');

return (
<>
<DocumentTitle>{title}</DocumentTitle>
Expand All @@ -139,7 +148,7 @@ export const AuthenticationErrorPage: React.FC = () => {
</Stack>
}
customFooter={
<ButtonLink variant="link" href="/logout">
<ButtonLink variant="primary" href="/">
{t('public~Try again')}
</ButtonLink>
}
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 @@ -534,12 +534,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