Skip to content

Commit

Permalink
fix (admin): wrong login shouldn't display the error notification
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-kerjean committed Oct 12, 2023
1 parent 1aad868 commit 0f50300
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions public/pages/adminpage/ctrl_login.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ export default async function(render) {
rxjs.map(() => ({ password: qs($form, "[name=\"password\"]").value })),
rxjs.switchMap((creds) => authenticate$(creds).pipe(
rxjs.catchError((err) => {
if (err instanceof AjaxError && err.code() === "INTERNAL_SERVER_ERROR") {
ctrlError(err)(render);
return rxjs.EMPTY;
if (err instanceof AjaxError) {
switch(err.code()) {
case "INTERNAL_SERVER_ERROR":
ctrlError(err)(render);
return rxjs.EMPTY;
case "FORBIDDEN":
return rxjs.of(false);
}
}
notification.error(err && err.message);
return rxjs.of(false);
Expand Down

0 comments on commit 0f50300

Please sign in to comment.