feat: Preserve authorization on browser refresh and close/reopen (#5939)
* Add default configuration `preserveAuthorization` * Add localStorage to auth plugin * Add persistAuthorization unit tests * Refactor persistAuthorization to use wrapped actions * Upgrade unit tests to be compatible with jest * Add persistAuthorization documentation Co-authored-by: Tim Lai <timothy.lai@gmail.com>
This commit is contained in:
committed by
GitHub
parent
48ee32faa1
commit
96aecc8860
@@ -27,7 +27,7 @@ export default class Auths extends React.Component {
|
||||
e.preventDefault()
|
||||
|
||||
let { authActions } = this.props
|
||||
authActions.authorize(this.state)
|
||||
authActions.authorizeWithPersistOption(this.state)
|
||||
}
|
||||
|
||||
logoutClick =(e) => {
|
||||
@@ -43,7 +43,7 @@ export default class Auths extends React.Component {
|
||||
return prev
|
||||
}, {}))
|
||||
|
||||
authActions.logout(auths)
|
||||
authActions.logoutWithPersistOption(auths)
|
||||
}
|
||||
|
||||
close =(e) => {
|
||||
|
||||
Reference in New Issue
Block a user