fix (admin): wrong login shouldn't display the error notification

This commit is contained in:
MickaelK 2023-10-12 03:18:10 -07:00
parent 1aad868640
commit 0f50300d39

View file

@ -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);