@@ -260,12 +260,6 @@ export default class AuthStore {
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
logout = async (savePath = false) => {
|
logout = async (savePath = false) => {
|
||||||
if (!this.token) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
client.post(`/auth.delete`);
|
|
||||||
|
|
||||||
// if this logout was forced from an authenticated route then
|
// if this logout was forced from an authenticated route then
|
||||||
// save the current path so we can go back there once signed in
|
// save the current path so we can go back there once signed in
|
||||||
if (savePath) {
|
if (savePath) {
|
||||||
@@ -276,10 +270,19 @@ export default class AuthStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there is no auth token stored there is nothing else to do
|
||||||
|
if (!this.token) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// invalidate authentication token on server
|
||||||
|
client.post(`/auth.delete`);
|
||||||
|
|
||||||
// remove authentication token itself
|
// remove authentication token itself
|
||||||
removeCookie("accessToken", {
|
removeCookie("accessToken", {
|
||||||
path: "/",
|
path: "/",
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove session record on apex cookie
|
// remove session record on apex cookie
|
||||||
const team = this.team;
|
const team = this.team;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user