Skip to content

Commit

Permalink
fix: don't throw on 401
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed May 27, 2021
1 parent 9e449e8 commit e9d989a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export const isSignedIn = async (): Promise<boolean> => {
try {
await client.whoami(config.user.token);
} catch (error) {
throw error;
if (error.status === 401) {
signout();

return false;
} else {
throw error;
}
}

return true;
Expand Down

0 comments on commit e9d989a

Please sign in to comment.