Merge pull request #472 from thecodingmachine/hotfix/privateAnonymousLogin
FIX: couldn't access to an anonymous private map
This commit is contained in:
commit
699d5f418a
@ -33,7 +33,7 @@ class ConnectionManager {
|
|||||||
|
|
||||||
const room = new Room(window.location.pathname + window.location.hash);
|
const room = new Room(window.location.pathname + window.location.hash);
|
||||||
return Promise.resolve(room);
|
return Promise.resolve(room);
|
||||||
} else if (connexionType === GameConnexionTypes.anonymous || connexionType === GameConnexionTypes.empty) {
|
} else if (connexionType === GameConnexionTypes.organization || connexionType === GameConnexionTypes.anonymous || connexionType === GameConnexionTypes.empty) {
|
||||||
const localUser = localUserStore.getLocalUser();
|
const localUser = localUserStore.getLocalUser();
|
||||||
|
|
||||||
if (localUser && localUser.jwtToken && localUser.uuid && localUser.textures) {
|
if (localUser && localUser.jwtToken && localUser.uuid && localUser.textures) {
|
||||||
@ -57,18 +57,6 @@ class ConnectionManager {
|
|||||||
}
|
}
|
||||||
const room = new Room(roomId);
|
const room = new Room(roomId);
|
||||||
return Promise.resolve(room);
|
return Promise.resolve(room);
|
||||||
} else if (connexionType == GameConnexionTypes.organization) {
|
|
||||||
const localUser = localUserStore.getLocalUser();
|
|
||||||
|
|
||||||
if (localUser) {
|
|
||||||
this.localUser = localUser;
|
|
||||||
await this.verifyToken(localUser.jwtToken);
|
|
||||||
const room = new Room(window.location.pathname + window.location.hash);
|
|
||||||
return Promise.resolve(room);
|
|
||||||
} else {
|
|
||||||
//todo: find some kind of fallback?
|
|
||||||
return Promise.reject('Could not find a user in localstorage');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.reject('Invalid URL');
|
return Promise.reject('Invalid URL');
|
||||||
|
@ -31,7 +31,8 @@ export class EntryScene extends Scene {
|
|||||||
create() {
|
create() {
|
||||||
gameManager.init(this.scene).then(() => {
|
gameManager.init(this.scene).then(() => {
|
||||||
this.scene.start(LoginSceneName);
|
this.scene.start(LoginSceneName);
|
||||||
}).catch(() => {
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
this.scene.start(FourOFourSceneName, {
|
this.scene.start(FourOFourSceneName, {
|
||||||
url: window.location.pathname.toString()
|
url: window.location.pathname.toString()
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user