Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
fix(UserManager): fix anonymous session monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kherock committed Dec 20, 2021
1 parent f901542 commit 577200e
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/UserManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,20 +400,19 @@ export class UserManager {
return null;
}
catch (err) {
if (this.settings.monitorAnonymousSession &&
err instanceof ErrorResponse && err.session_state) {
if (err.message == "login_required" ||
err.message == "consent_required" ||
err.message == "interaction_required" ||
err.message == "account_selection_required"
) {
this._logger.info("querySessionStatus: querySessionStatus success for anonymous user");
return {
session_state: err.session_state,
};
if (this.settings.monitorAnonymousSession && err instanceof ErrorResponse) {
switch (err.error) {
case "login_required":
case "consent_required":
case "interaction_required":
case "account_selection_required":
this._logger.info("querySessionStatus: querySessionStatus success for anonymous user");
return {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
session_state: err.session_state!,
};
}
}

throw err;
}
}
Expand Down

0 comments on commit 577200e

Please sign in to comment.