fix: Post-signin redirect path is no longer saved (#4054)

closes #4045
This commit is contained in:
Tom Moor
2022-09-04 12:56:12 +02:00
committed by GitHub
parent c964163cc5
commit c8b12a59e2

View File

@ -260,12 +260,6 @@ export default class AuthStore {
@action
logout = async (savePath = false) => {
if (!this.token) {
return;
}
client.post(`/auth.delete`);
// if this logout was forced from an authenticated route then
// save the current path so we can go back there once signed in
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
removeCookie("accessToken", {
path: "/",
});
// remove session record on apex cookie
const team = this.team;