🔥 refactor(authContext.tsx): remove unused code related to localStorage and comments
🔒 chore(authContext.tsx): remove unused code related to cookies and comments
This commit is contained in:
parent
3bf069565f
commit
0ec8d43fd6
1 changed files with 0 additions and 5 deletions
|
|
@ -41,7 +41,6 @@ export function AuthProvider({ children }): React.ReactElement {
|
|||
}
|
||||
|
||||
function login(newAccessToken: string, refreshToken: string) {
|
||||
//if we want to use cookie
|
||||
cookies.set('access_token', newAccessToken, { path: '/' });
|
||||
cookies.set('refresh_token', refreshToken, { path: '/' });
|
||||
setAccessToken(newAccessToken);
|
||||
|
|
@ -50,12 +49,8 @@ export function AuthProvider({ children }): React.ReactElement {
|
|||
}
|
||||
|
||||
function logout() {
|
||||
//if we want to use cookie
|
||||
cookies.remove('access_token');
|
||||
cookies.remove('refresh_token');
|
||||
|
||||
localStorage.removeItem("access_token");
|
||||
localStorage.removeItem("refresh_token");
|
||||
setAccessToken(null);
|
||||
setRefreshToken(null);
|
||||
setIsAuthenticated(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue