Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const useAuthActions = () => {
return {
logout: () => {
localStorage.removeItem('jwtToken');
localStorage.removeItem('refreshToken');
Comment on lines 36 to +37
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a clearTokens() utility function already available in frontend/src/components/login/tokenUtils.ts that handles removing both jwtToken and refreshToken. Consider using that function instead of manually removing tokens to maintain consistency with other logout implementations in the codebase (e.g., the logout function in useLogin.ts already uses clearTokens()).

Copilot uses AI. Check for mistakes.
localStorage.setItem('tokenRemovalTime', Date.now().toString());
queryClient.invalidateQueries({ queryKey: AUTH_QUERY_KEY });
},
Expand All @@ -45,6 +46,7 @@ export const useAuthActions = () => {

export const logout = () => {
localStorage.removeItem('jwtToken');
localStorage.removeItem('refreshToken');
Comment on lines 48 to +49
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a clearTokens() utility function already available in frontend/src/components/login/tokenUtils.ts that handles removing both jwtToken and refreshToken. Consider using that function instead of manually removing tokens to maintain consistency with other logout implementations in the codebase (e.g., the logout function in useLogin.ts already uses clearTokens()).

Copilot uses AI. Check for mistakes.
localStorage.setItem('tokenRemovalTime', Date.now().toString());
window.dispatchEvent(new Event('storage'));
};
Expand Down
Loading