added a register route via token

This commit is contained in:
arp 2020-09-17 18:08:20 +02:00
parent 1ccbea30e4
commit ed9552b62b
7 changed files with 76 additions and 3 deletions

View file

@ -10,10 +10,11 @@ import {FourOFourScene} from "./Phaser/Reconnecting/FourOFourScene";
import WebGLRenderer = Phaser.Renderer.WebGL.WebGLRenderer;
import {OutlinePipeline} from "./Phaser/Shaders/OutlinePipeline";
import {CustomizeScene} from "./Phaser/Login/CustomizeScene";
import {HtmlUtils} from "./WebRtc/HtmlUtils";
import {CoWebsiteManager} from "./WebRtc/CoWebsiteManager";
import {redirectIfToken} from "./register";
//CoWebsiteManager.loadCoWebsite('https://thecodingmachine.com');
redirectIfToken();
// Load Jitsi if the environment variable is set.
if (JITSI_URL) {

12
front/src/register.ts Normal file
View file

@ -0,0 +1,12 @@
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;
});
}
}