Merge branch 'develop' of github.com:thecodingmachine/workadventure into main
This commit is contained in:
@@ -76,7 +76,17 @@ class ConnectionManager {
|
||||
);
|
||||
localUserStore.setAuthToken(authToken);
|
||||
this.authToken = authToken;
|
||||
room = await Room.createRoom(new URL(localUserStore.getLastRoomUrl()));
|
||||
|
||||
let roomPath: string;
|
||||
|
||||
roomPath = window.location.protocol + "//" + window.location.host + START_ROOM_URL;
|
||||
|
||||
const lastRoomUrl = localUserStore.getLastRoomUrl();
|
||||
if (lastRoomUrl != undefined && lastRoomUrl != "") {
|
||||
roomPath = lastRoomUrl;
|
||||
}
|
||||
|
||||
room = await Room.createRoom(new URL(roomPath));
|
||||
urlManager.pushRoomIdToUrl(room);
|
||||
} else if (connexionType === GameConnexionTypes.register) {
|
||||
//@deprecated
|
||||
@@ -110,13 +120,23 @@ class ConnectionManager {
|
||||
this.authToken = localUserStore.getAuthToken();
|
||||
//todo: add here some kind of warning if authToken has expired.
|
||||
if (!this.authToken) {
|
||||
await this.anonymousLogin();
|
||||
await this.anonymousLogin();
|
||||
// this.loadOpenIDScreen();
|
||||
}
|
||||
this.localUser = localUserStore.getLocalUser() as LocalUser; //if authToken exist in localStorage then localUser cannot be null
|
||||
|
||||
let roomPath: string;
|
||||
if (connexionType === GameConnexionTypes.empty) {
|
||||
roomPath = window.location.protocol + "//" + window.location.host + START_ROOM_URL;
|
||||
//get last room path from cache api
|
||||
try {
|
||||
const lastRoomUrl = await localUserStore.getLastRoomUrlCacheApi();
|
||||
if (lastRoomUrl != undefined) {
|
||||
roomPath = lastRoomUrl;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
} else {
|
||||
roomPath =
|
||||
window.location.protocol +
|
||||
|
||||
Reference in New Issue
Block a user