Skip to content

Commit 3be93be

Browse files
fix: add 401 interceptor to force logout (#45)
1 parent d553004 commit 3be93be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export class Client {
8484
}
8585
return response.data;
8686
} catch (e: any) {
87-
if (e?.exception === "AccessDenied Token Error") {
87+
if (
88+
e?.exception === "AccessDenied Token Error" ||
89+
e?.response?.status === 401
90+
) {
8891
this.onTokenAccessDenied?.(e);
8992
}
9093

0 commit comments

Comments
 (0)