Skip to content

Commit

Permalink
Merge pull request #1623 from SUNET/eunju-replace-logout-error
Browse files Browse the repository at this point in the history
display logout button on error
  • Loading branch information
cartja authored Feb 7, 2024
2 parents 18a7344 + 3d6511e commit 2a5715e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/components/Common/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { FormattedMessage } from "react-intl";
import { HeaderNav } from "./HeaderNav";

interface HeaderProps {
email?: string;
showLogin?: boolean;
showLogout?: boolean;
showMenu?: boolean;
showRegister?: boolean;
loginRef?: string;
readonly showLogin?: boolean;
readonly showLogout?: boolean;
readonly showMenu?: boolean;
readonly showRegister?: boolean;
readonly loginRef?: string;
}

export function Header(props: HeaderProps): JSX.Element {
Expand Down
7 changes: 6 additions & 1 deletion src/components/Login/LoginMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ export function LoginMain(): JSX.Element {
const isLoaded = useAppSelector((state) => state.app.is_loaded);
const authn_options = useAppSelector((state) => state.login.authn_options);
const loginRef = useAppSelector((state) => state.login.ref);
const error = useAppSelector((state) => state.notifications.error);

return (
<React.StrictMode>
<Header showRegister={!authn_options.has_session} showLogout={authn_options.has_session} loginRef={loginRef} />
<Header
showRegister={!authn_options.has_session}
showLogout={authn_options.has_session || Boolean(error)}
loginRef={loginRef}
/>
<main id="panel" className="panel">
<Notifications />
<ErrorBoundary FallbackComponent={GenericError}>
Expand Down

0 comments on commit 2a5715e

Please sign in to comment.