Skip to content
Snippets Groups Projects
Commit 4f834124 authored by nahyun's avatar nahyun
Browse files

change

parent 9e8d2a29
No related branches found
No related tags found
1 merge request!5Logout
......@@ -51,16 +51,12 @@ function App() {
const [user, setUser] = useState(() => {
const token = localStorage.getItem('token');
if (token) {
try {
const decoded = jwt_decode(token);
return {
_id: decoded.userId,
email: decoded.email,
name: decoded.name
};
} catch (error) {
return null;
}
}
return null;
});
......@@ -159,7 +155,7 @@ function App() {
console.log('토큰 갱신 시도...');
await refreshToken();
} else {
console.log(`토큰 갱신까지 ${Math.ceil(2 - timeSinceLastRefresh/1000/60)}분 남음`);
console.log(`토큰 갱신까지 ${Math.ceil((process.env.REACT_APP_TOKEN_EXPIRATION-1) - timeSinceLastRefresh/1000/60)}분 남음`);
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment