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