fix: catch refresh token error

This commit is contained in:
alt0
2022-12-22 22:03:55 +08:00
parent 88bb20505e
commit 6c99f8b636
@@ -172,7 +172,10 @@ export const AppStateProvider = ({ children }: { children?: ReactNode }) => {
}));
};
token.onChange(callback);
token.refreshToken();
token.refreshToken().catch(err => {
// FIXME: should resolve invalid refresh token
console.log(err);
});
return () => {
token.offChange(callback);
};