12 lines
371 B
TypeScript
12 lines
371 B
TypeScript
import Axios from "axios";
|
|
import {API_URL} from "./Enum/EnvironmentVariable";
|
|
declare let window:Window;
|
|
|
|
export function redirectIfToken() {
|
|
const match = window.location.toString().match(/\/register\/(.+)/);
|
|
if (match) {
|
|
Axios.get(`${API_URL}/register/`+match[1]).then((res) => {
|
|
window.location = res.data.loginUrl;
|
|
});
|
|
}
|
|
} |