Skip to content

Commit

Permalink
STCOR-803 Add config option for logout mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandberger committed Feb 13, 2024
1 parent a52695a commit b9d2604
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/RootWithIntl.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ import PreLoginLanding from './components/PreLoginLanding';
import { setOkapiTenant } from './okapiActions';

export const renderLogoutComponent = (stripes) => {
const { okapi } = stripes;
const { okapi, config } = stripes;

if (okapi.authnUrl) {
if (okapi.authnUrl && config.confirmLogout) {
return <Redirect to={`${okapi.authnUrl}/realms/${okapi.tenant}/protocol/openid-connect/logout?client_id=${okapi.clientId}&post_logout_redirect_uri=${window.location.protocol}//${window.location.host}`} />;
}

Expand Down
2 changes: 1 addition & 1 deletion src/RootWithIntl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('RootWithIntl', () => {
it('handles third-party logout', () => {
const stripes = {
okapi: { authnUrl: 'https://oppie.com' },
config: { },
config: { confirmLogout: true },
};
render(renderLogoutComponent(stripes));

Expand Down

0 comments on commit b9d2604

Please sign in to comment.