update logout logic
This commit is contained in:
1 parent
f22d21bb53
commit
7e23b014b6
4 files changed
+19
-14
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { removeCookie } from 'typescript-cookie';
|
||||
|
||||
export const removeCookies = () => {
|
||||
const host = window.location.host;
|
||||
// process test env and prod env, for example:
|
||||
// auth.zhishuyun.com -> .zhishuyun.com
|
||||
// auth.test.zhishuyun.com -> .zhishuyun.com
|
||||
const domain = host.replace(/^\S+?\.(test\.|local\.)?/, '.');
|
||||
const path = '/';
|
||||
// remove tokens from cookies
|
||||
removeCookie('ACCESS_TOKEN', { domain, path });
|
||||
removeCookie('REFRESH_TOKEN', { domain, path });
|
||||
};
|
||||
Reference in new issue
Block a user