secure DISABLE_ANONYMOUS
This commit is contained in:
@@ -44,13 +44,22 @@ class ConnectionManager {
|
||||
|
||||
//TODO fix me to redirect this URL by pusher
|
||||
if (!this._currentRoom) {
|
||||
console.error("cannot get currentRoom!");
|
||||
loginSceneVisibleIframeStore.set(false);
|
||||
return null;
|
||||
}
|
||||
|
||||
const redirectUrl = `${PUSHER_URL}/login-screen?state=${state}&nonce=${nonce}&playUri=${this._currentRoom.key}`;
|
||||
window.location.assign(redirectUrl);
|
||||
// also allow OIDC login without admin API by using pusher
|
||||
let redirectUrl : URL;
|
||||
if (this._currentRoom.iframeAuthentication) {
|
||||
redirectUrl = new URL(`${this._currentRoom.iframeAuthentication}`);
|
||||
} else {
|
||||
// need origin if PUSHER_URL is relative (in Single-Domain-Deployment)
|
||||
redirectUrl = new URL(`${PUSHER_URL}/login-screen`, (!PUSHER_URL.startsWith('http:') || !PUSHER_URL.startsWith('https:')) ? window.location.origin : undefined);
|
||||
}
|
||||
redirectUrl.searchParams.append("state", state);
|
||||
redirectUrl.searchParams.append("nonce", nonce);
|
||||
redirectUrl.searchParams.append("playUri", this._currentRoom.key);
|
||||
window.location.assign(redirectUrl.toString());
|
||||
return redirectUrl;
|
||||
}
|
||||
|
||||
|
||||
+10
-13
@@ -18,7 +18,7 @@ export class Room {
|
||||
private _iframeAuthentication?: string;
|
||||
private _mapUrl: string | undefined;
|
||||
private _textures: CharacterTexture[] | undefined;
|
||||
// private instance: string | undefined;
|
||||
private instance: string | undefined;
|
||||
private readonly _search: URLSearchParams;
|
||||
private _contactPage: string | undefined;
|
||||
private _group: string | null = null;
|
||||
@@ -75,13 +75,12 @@ export class Room {
|
||||
const baseUrl = new URL(currentRoomUrl);
|
||||
|
||||
const currentRoom = new Room(baseUrl);
|
||||
// let instance: string = "global";
|
||||
// if (currentRoom.isPublic) {
|
||||
// instance = currentRoom.instance as string;
|
||||
//}
|
||||
let instance: string = "global";
|
||||
if (currentRoom.isPublic) {
|
||||
instance = currentRoom.instance as string;
|
||||
}
|
||||
|
||||
// baseUrl.pathname = "/_/" + instance + "/" + absoluteExitSceneUrl.host + absoluteExitSceneUrl.pathname;
|
||||
baseUrl.pathname = "/_/" + absoluteExitSceneUrl.host + absoluteExitSceneUrl.pathname;
|
||||
baseUrl.pathname = "/_/" + instance + "/" + absoluteExitSceneUrl.host + absoluteExitSceneUrl.pathname;
|
||||
if (absoluteExitSceneUrl.hash) {
|
||||
baseUrl.hash = absoluteExitSceneUrl.hash;
|
||||
}
|
||||
@@ -119,8 +118,6 @@ export class Room {
|
||||
* - In a private URL: [organizationId/worldId]
|
||||
*/
|
||||
public getInstance(): string {
|
||||
return "";
|
||||
/*
|
||||
if (this.instance !== undefined) {
|
||||
return this.instance;
|
||||
}
|
||||
@@ -131,12 +128,12 @@ export class Room {
|
||||
this.instance = match[1];
|
||||
return this.instance;
|
||||
} else {
|
||||
const match = /@\/([^/]+)\/([^/]+)\/.+/.exec(this.id);
|
||||
if (!match) throw new Error('Could not extract instance from "' + this.id + '"');
|
||||
this.instance = match[1] + "/" + match[2];
|
||||
//const match = /@\/([^/]+)\/([^/]+)\/.+/.exec(this.id);
|
||||
//if (!match) throw new Error('Could not extract instance from "' + this.id + '"');
|
||||
//this.instance = match[1] + "/" + match[2];
|
||||
this.instance = ""
|
||||
return this.instance;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public isDisconnected(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user