Skip to content

Commit

Permalink
STCOR-761 allow console to be preserved on logout (#1367)
Browse files Browse the repository at this point in the history
Normally the console is cleared on logout. This is good for security but
bad for debugging in the case where a user may be automatically logged
out due to RTR.

Refs STCOR-761
  • Loading branch information
zburke authored and Dmitriy-Litvinenko committed Nov 23, 2023
1 parent df919dc commit 161edd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Use cookies and RTR instead of directly handling the JWT. Refs STCOR-671, FOLIO-3627.
* Shrink the token lifespan so we are less likely to use an expired one. Refs STCOR-754.
* Correctly evaluate token lifespan; use consistent protocol for service worker messages. Refs STCOR-756.
* Allow console to be preserved on logout. STCOR-761.

## [10.0.0](https://github.com/folio-org/stripes-core/tree/v10.0.0) (2023-10-11)
[Full Changelog](https://github.com/folio-org/stripes-core/compare/v9.0.0...v10.0.0)
Expand Down
6 changes: 4 additions & 2 deletions src/components/MainNav/MainNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { compose } from 'redux';
import { injectIntl } from 'react-intl';
import { withRouter } from 'react-router';

import { branding } from 'stripes-config';
import { branding, config } from 'stripes-config';

import { Icon } from '@folio/stripes-components';

Expand Down Expand Up @@ -126,7 +126,9 @@ class MainNav extends Component {

// return the user to the login screen, but after logging in they will be brought to the default screen.
logout() {
console.clear(); // eslint-disable-line no-console
if (!config.preserveConsole) {
console.clear(); // eslint-disable-line no-console
}
this.returnToLogin().then(() => {
this.props.history.push('/');
});
Expand Down

0 comments on commit 161edd4

Please sign in to comment.