//
// SPDX-License-Identifier: AGPL-3.0
-import Axios from "axios";
import { API_HOST } from "../../common/server-api";
import { User } from "../../models/user";
-const API_TOKEN_KEY = 'apiToken';
-const USER_EMAIL_KEY = 'userEmail';
-const USER_FIRST_NAME_KEY = 'userFirstName';
-const USER_LAST_NAME_KEY = 'userLastName';
+export const API_TOKEN_KEY = 'apiToken';
+export const USER_EMAIL_KEY = 'userEmail';
+export const USER_FIRST_NAME_KEY = 'userFirstName';
+export const USER_LAST_NAME_KEY = 'userLastName';
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}`);
}
}