From ac71b145d7f69dddbbc8621028a0b717aa897592 Mon Sep 17 00:00:00 2001 From: CombatPug Date: Tue, 17 Sep 2024 23:23:23 +0200 Subject: [PATCH] fix: throw an error on !ok status in login (#43) --- services/auth.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/auth.service.ts b/services/auth.service.ts index 260ee00..732ae20 100644 --- a/services/auth.service.ts +++ b/services/auth.service.ts @@ -30,6 +30,8 @@ const login = async (apiBase: string, password: string) => { if (!res.ok) { if (res.status === 403) { throw new Error('The password you’ve entered is invalid. Please enter the correct password'); + } else { + throw new Error('Something went wrong. Please try again later.'); } } localStorage.setItem(isLoggedInKey, 'true');