mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-11 03:34:00 +02:00
Fix logout not working
This commit is contained in:
@@ -2,7 +2,10 @@ import Cookies from 'js-cookie';
|
|||||||
import { TOKEN_COOKIE_NAME } from '../../lib/jwt';
|
import { TOKEN_COOKIE_NAME } from '../../lib/jwt';
|
||||||
|
|
||||||
export function logout() {
|
export function logout() {
|
||||||
Cookies.remove(TOKEN_COOKIE_NAME);
|
Cookies.remove(TOKEN_COOKIE_NAME, {
|
||||||
|
path: '/',
|
||||||
|
domain: import.meta.env.DEV ? 'localhost' : '.roadmap.sh',
|
||||||
|
});
|
||||||
|
|
||||||
// Reloading will automatically redirect the user if required
|
// Reloading will automatically redirect the user if required
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
Reference in New Issue
Block a user