Skip to content

Commit

Permalink
fix: throw an error on !ok status in login (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
PudgyPug authored Sep 17, 2024
1 parent 00e201b commit ac71b14
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit ac71b14

Please sign in to comment.