diff --git a/frontend/src/services/auth.ts b/frontend/src/services/auth.ts index a61a6d3..9c5485f 100644 --- a/frontend/src/services/auth.ts +++ b/frontend/src/services/auth.ts @@ -92,6 +92,10 @@ export const login = async (username: string, password: string) => { // Logout function export const logout = () => { + // Store the current path before redirecting to login + localStorage.setItem("redirect_after_login", window.location.pathname); + + // Clear tokens and redirect to login page localStorage.removeItem("access_token"); localStorage.removeItem("refresh_token"); window.location.href = "/user/login"; // Redirect to login page