Merge branch 'develop' of github.com:thecodingmachine/workadventure
This commit is contained in:
Vendored
+1
-1
@@ -23,4 +23,4 @@ RewriteCond %{REQUEST_FILENAME} !-f
|
|||||||
RewriteRule "^[_@]/" "/index.html" [L]
|
RewriteRule "^[_@]/" "/index.html" [L]
|
||||||
RewriteRule "^register/" "/index.html" [L]
|
RewriteRule "^register/" "/index.html" [L]
|
||||||
RewriteRule "^login" "/index.html" [L]
|
RewriteRule "^login" "/index.html" [L]
|
||||||
RewriteRule "^jwt/" "/index.html" [L]
|
RewriteRule "^jwt" "/index.html" [L]
|
||||||
|
|||||||
@@ -81,8 +81,10 @@ class ConnectionManager {
|
|||||||
this._currentRoom = null;
|
this._currentRoom = null;
|
||||||
if (connexionType === GameConnexionTypes.login) {
|
if (connexionType === GameConnexionTypes.login) {
|
||||||
this._currentRoom = await Room.createRoom(new URL(localUserStore.getLastRoomUrl()));
|
this._currentRoom = await Room.createRoom(new URL(localUserStore.getLastRoomUrl()));
|
||||||
this.loadOpenIDScreen();
|
if (this.loadOpenIDScreen() !== null) {
|
||||||
return Promise.reject(new Error("You will be redirect on login page"));
|
return Promise.reject(new Error("You will be redirect on login page"));
|
||||||
|
}
|
||||||
|
urlManager.pushRoomIdToUrl(this._currentRoom);
|
||||||
} else if (connexionType === GameConnexionTypes.jwt) {
|
} else if (connexionType === GameConnexionTypes.jwt) {
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
const code = urlParams.get("code");
|
const code = urlParams.get("code");
|
||||||
@@ -191,7 +193,7 @@ class ConnectionManager {
|
|||||||
return Promise.reject(new Error("Invalid URL"));
|
return Promise.reject(new Error("Invalid URL"));
|
||||||
}
|
}
|
||||||
if (this.localUser) {
|
if (this.localUser) {
|
||||||
analyticsClient.identifyUser(this.localUser.uuid)
|
analyticsClient.identifyUser(this.localUser.uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.serviceWorker = new _ServiceWorker();
|
this.serviceWorker = new _ServiceWorker();
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ export class AuthenticateController extends BaseController {
|
|||||||
console.warn("/message request was aborted");
|
console.warn("/message request was aborted");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
const { nonce, state, playUri } = parse(req.getQuery());
|
const { nonce, state, playUri } = parse(req.getQuery());
|
||||||
if (!state || !nonce) {
|
if (!state || !nonce) {
|
||||||
res.writeStatus("400 Unauthorized").end("missing state and nonce URL parameters");
|
throw "missing state and nonce URL parameters";
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
const loginUri = await openIDClient.authorizationUrl(
|
const loginUri = await openIDClient.authorizationUrl(
|
||||||
state as string,
|
state as string,
|
||||||
nonce as string,
|
nonce as string,
|
||||||
@@ -45,6 +45,7 @@ export class AuthenticateController extends BaseController {
|
|||||||
res.writeHeader("Location", loginUri);
|
res.writeHeader("Location", loginUri);
|
||||||
return res.end();
|
return res.end();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error("openIDLogin => e", e);
|
||||||
return this.errorToResponse(e, res);
|
return this.errorToResponse(e, res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -85,6 +86,7 @@ export class AuthenticateController extends BaseController {
|
|||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
return res.end(JSON.stringify({ authToken: authToken, username: userInfo.username, userUuid : sub }));
|
return res.end(JSON.stringify({ authToken: authToken, username: userInfo.username, userUuid : sub }));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error("openIDCallback => ERROR", e);
|
||||||
return this.errorToResponse(e, res);
|
return this.errorToResponse(e, res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -155,6 +157,7 @@ export class AuthenticateController extends BaseController {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.error("register => ERROR", e);
|
||||||
this.errorToResponse(e, res);
|
this.errorToResponse(e, res);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
@@ -231,6 +234,7 @@ export class AuthenticateController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error("profileCallback => ERROR", error);
|
||||||
this.errorToResponse(error, res);
|
this.errorToResponse(error, res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user