Make login/logout tests compatible with jsdom
[arvados.git] / src / services / auth-service / auth-service.ts
index 9e75c72a9fa54f8fa27a2f33c657506823d04556..4b213fb06cb727f62bf5c7e02326d56c077d350d 100644 (file)
@@ -47,11 +47,11 @@ export default class AuthService {
 
     public login() {
         const currentUrl = `${window.location.protocol}//${window.location.host}/token`;
-        window.location.href = `${API_HOST}/login?return_to=${currentUrl}`;
+        window.location.assign(`${API_HOST}/login?return_to=${currentUrl}`);
     }
 
     public logout() {
         const currentUrl = `${window.location.protocol}//${window.location.host}`;
-        window.location.href = `${API_HOST}/logout?return_to=${currentUrl}`;
+        window.location.assign(`${API_HOST}/logout?return_to=${currentUrl}`);
     }
 }