Skip to content

Commit

Permalink
Handle unknown statuses as an error
Browse files Browse the repository at this point in the history
At first I opted to handle the 'invalid-request' manually. But having a
default switch-case to handle all unhandled stati as an error makes more
sense.

And before this commit, the invalid request was handled as a Push
Notification failure. But that was not my intention. I wanted to render
the error page, and for that, we need to call the switchToStatusRequestError
method instead.
  • Loading branch information
MKodde committed Sep 11, 2024
1 parent 4160478 commit f929e11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/typescript/AuthenticationPageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ export class AuthenticationPageService {
case 'challenge-expired':
this.switchToChallengeHasExpired();
break;
case 'invalid-request':
this.switchToNotificationFailed();
break;
case 'needs-refresh':
this.reloadPage();
break;
default:
this.switchToStatusRequestError();
break;
}
};

Expand Down

0 comments on commit f929e11

Please sign in to comment.