window.location.assign(`https://${homeClusterHost}/login?${(uuidPrefix !== homeCluster && homeCluster !== loginCluster) ? "remote=" + uuidPrefix + "&" : ""}return_to=${currentUrl}`);
}
- public logout() {
+ public logout(expireToken: string) {
const currentUrl = `${window.location.protocol}//${window.location.host}`;
- window.location.assign(`${this.baseUrl || ""}/logout?return_to=${currentUrl}`);
+ window.location.assign(`${this.baseUrl || ""}/logout?api_token=${expireToken}&return_to=${currentUrl}`);
}
public getUserDetails = (showErrors?: boolean): Promise<User> => {
const middleware = authMiddleware(services)(store)(next);
middleware(authActions.LOGOUT({deleteLinkData: false}));
expect(window.location.assign).toBeCalledWith(
- `/logout?return_to=${location.protocol}//${location.host}`
+ `/logout?api_token=someToken&return_to=${location.protocol}//${location.host}`
);
expect(localStorage.getItem(API_TOKEN_KEY)).toBeFalsy();
});
if (deleteLinkData) {
services.linkAccountService.removeAccountToLink();
}
+ const token = services.authService.getApiToken();
services.authService.removeApiToken();
services.authService.removeSessions();
services.authService.removeUser();
removeAuthorizationHeader(services);
- services.authService.logout();
+ services.authService.logout(token || '');
},
default: () => next(action)
});