fix
This commit is contained in:
parent
4ec957cbcd
commit
534aeb9d50
@ -3,7 +3,7 @@ import { TokensContext } from 'raisa-fastapi-protected-web';
|
||||
import { createContext, useCallback, useContext, useEffect, useState } from 'react';
|
||||
import { AuthApi } from '../../api/auth';
|
||||
import { UsersApi } from '../../api/users';
|
||||
import { getAuthToken, isTokenExpired, saveAuthTokens } from '../../api/utils/token';
|
||||
import { clearAuthTokens, getAuthToken, isTokenExpired, saveAuthTokens } from '../../api/utils/token';
|
||||
import { Config } from '../../conf/config';
|
||||
|
||||
const AuthContext = createContext(null);
|
||||
@ -131,6 +131,7 @@ const ProductionAuthProvider = ({ children }) => {
|
||||
const keycloakAccessToken = tokenInfo?.accessToken;
|
||||
|
||||
if (!keycloakAccessToken) {
|
||||
clearAuthTokens();
|
||||
setLoading(true);
|
||||
setIsAuthenticated(false);
|
||||
setUser(null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user