Skip to content

Commit

Permalink
Fixed: logout loader on login by only displaying the loader when user…
Browse files Browse the repository at this point in the history
… is authorized(#337)
  • Loading branch information
ymaheshwari1 committed Mar 7, 2024
1 parent 3c9a4ee commit 9266903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ const actions: ActionTree<UserState, RootState> = {
// store the url on which we need to redirect the user after logout api completes in case of SSO enabled
let redirectionUrl = ''

emitter.emit('presentLoader', { message: 'Logging out', backdropDismiss: false })

// Calling the logout api to flag the user as logged out, only when user is authorised
// if the user is already unauthorised then not calling the logout api as it returns 401 again that results in a loop, thus there is no need to call logout api if the user is unauthorised
if(!payload?.isUserUnauthorised) {
emitter.emit('presentLoader', { message: 'Logging out', backdropDismiss: false })

let resp;

// wrapping the parsing logic in try catch as in some case the logout api makes redirection, and then we are unable to parse the resp and thus the logout process halts
Expand Down

0 comments on commit 9266903

Please sign in to comment.