fix missing authToken causing crash

This commit is contained in:
Sidney Alcantara
2021-09-20 12:20:56 +10:00
parent c0cc69da6f
commit 70ed3dc3f4

View File

@@ -63,7 +63,7 @@ export const AppProvider: React.FC = ({ children }) => {
const getAuthToken = async () => {
// check if token is expired
if (currentUser) {
if (currentUser && authToken) {
const token: any = jwt_decode(authToken);
if (token && token.exp * 1000 < Date.now()) {
// token is expired