mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-28 19:22:31 +01:00
fix (admin): wrong login shouldn't display the error notification
This commit is contained in:
parent
1aad868640
commit
0f50300d39
1 changed files with 8 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue