Merge branch 'master' of github.com:thecodingmachine/workadventure into develop
# Conflicts: # front/src/Connexion/ConnectionManager.ts # pusher/src/Controller/AuthenticateController.ts # pusher/src/Controller/IoSocketController.ts # pusher/src/Services/JWTTokenManager.ts
This commit is contained in:
commit
4e042389c5
8 changed files with 64 additions and 18 deletions
|
@ -269,7 +269,7 @@ class IframeListener {
|
|||
|
||||
registerScript(scriptUrl: string): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
console.log("Loading map related script at ", scriptUrl);
|
||||
console.info("Loading map related script at ", scriptUrl);
|
||||
|
||||
if (!process.env.NODE_ENV || process.env.NODE_ENV === "development") {
|
||||
// Using external iframe mode (
|
||||
|
|
|
@ -111,7 +111,7 @@ class ConnectionManager {
|
|||
|
||||
this._currentRoom = await Room.createRoom(new URL(localUserStore.getLastRoomUrl()));
|
||||
try {
|
||||
await this.checkAuthUserConnexion();
|
||||
await this.checkAuthUserConnexion(this._currentRoom.key);
|
||||
analyticsClient.loggedWithSso();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
@ -177,6 +177,9 @@ class ConnectionManager {
|
|||
//before set token of user we must load room and all information. For example the mandatory authentication could be require on current room
|
||||
this._currentRoom = await Room.createRoom(new URL(roomPath));
|
||||
|
||||
//defined last room url this room path
|
||||
localUserStore.setLastRoomUrl(this._currentRoom.key);
|
||||
|
||||
//todo: add here some kind of warning if authToken has expired.
|
||||
if (!this.authToken && !this._currentRoom.authenticationMandatory) {
|
||||
await this.anonymousLogin();
|
||||
|
@ -293,7 +296,7 @@ class ConnectionManager {
|
|||
return this.connexionType;
|
||||
}
|
||||
|
||||
async checkAuthUserConnexion() {
|
||||
async checkAuthUserConnexion(playUri: string) {
|
||||
//set connected store for menu at false
|
||||
userIsConnected.set(false);
|
||||
|
||||
|
@ -310,10 +313,12 @@ class ConnectionManager {
|
|||
throw "No Auth code provided";
|
||||
}
|
||||
}
|
||||
const { authToken } = await Axios.get(`${PUSHER_URL}/login-callback`, { params: { code, nonce, token } }).then(
|
||||
const { authToken, userUuid, textures, email } = await Axios.get(`${PUSHER_URL}/login-callback`, { params: { code, nonce, token } }).then(
|
||||
(res) => res.data
|
||||
);
|
||||
localUserStore.setAuthToken(authToken);
|
||||
this.localUser = new LocalUser(userUuid, textures, email);
|
||||
localUserStore.saveUser(this.localUser);
|
||||
this.authToken = authToken;
|
||||
|
||||
//user connected, set connected store for menu at true
|
||||
|
|
|
@ -67,6 +67,9 @@ function createChatMessagesStore() {
|
|||
});
|
||||
},
|
||||
addPersonnalMessage(text: string) {
|
||||
//post message iframe listener
|
||||
iframeListener.sendUserInputChat(text);
|
||||
|
||||
newChatMessageStore.set(text);
|
||||
update((list) => {
|
||||
const lastMessage = list[list.length - 1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue