parent
ee7d9a898d
commit
c70e247458
@ -1,12 +1,13 @@
|
|||||||
import { destroyCookie } from 'nookies';
|
import { parseCookies, destroyCookie } from 'nookies';
|
||||||
|
|
||||||
import { apiUserLogout } from '@/services';
|
import { apiUserLogout } from '@/services';
|
||||||
|
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
apiUserLogout();
|
const { token } = parseCookies();
|
||||||
localStorage.clear();
|
|
||||||
destroyCookie(null, 'token');
|
destroyCookie(null, 'token');
|
||||||
window.location.reload();
|
localStorage.clear();
|
||||||
|
apiUserLogout(token);
|
||||||
|
window.location.replace('/');
|
||||||
};
|
};
|
||||||
|
|
||||||
export default logout;
|
export default logout;
|
||||||
|
Loading…
Reference in new issue