Merge branch 'master' into develop
Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
This commit is contained in:
commit
f247ec44f1
2
front/dist/.htaccess
vendored
2
front/dist/.htaccess
vendored
@ -23,4 +23,4 @@ RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule "^[_@]/" "/index.html" [L]
|
||||
RewriteRule "^register/" "/index.html" [L]
|
||||
RewriteRule "^login" "/index.html" [L]
|
||||
RewriteRule "^jwt/" "/index.html" [L]
|
||||
RewriteRule "^jwt" "/index.html" [L]
|
||||
|
@ -9,7 +9,7 @@ import { Room } from "./Room";
|
||||
import { _ServiceWorker } from "../Network/ServiceWorker";
|
||||
import { loginSceneVisibleIframeStore } from "../Stores/LoginSceneStore";
|
||||
import { userIsConnected } from "../Stores/MenuStore";
|
||||
import {analyticsClient} from "../Administration/AnalyticsClient";
|
||||
import { analyticsClient } from "../Administration/AnalyticsClient";
|
||||
|
||||
class ConnectionManager {
|
||||
private localUser!: LocalUser;
|
||||
@ -78,8 +78,10 @@ class ConnectionManager {
|
||||
this._currentRoom = null;
|
||||
if (connexionType === GameConnexionTypes.login) {
|
||||
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"));
|
||||
}
|
||||
urlManager.pushRoomIdToUrl(this._currentRoom);
|
||||
} else if (connexionType === GameConnexionTypes.jwt) {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const code = urlParams.get("code");
|
||||
@ -188,7 +190,7 @@ class ConnectionManager {
|
||||
return Promise.reject(new Error("Invalid URL"));
|
||||
}
|
||||
if (this.localUser) {
|
||||
analyticsClient.identifyUser(this.localUser.uuid)
|
||||
analyticsClient.identifyUser(this.localUser.uuid);
|
||||
}
|
||||
|
||||
this.serviceWorker = new _ServiceWorker();
|
||||
|
@ -27,12 +27,12 @@ export class AuthenticateController extends BaseController {
|
||||
console.warn("/message request was aborted");
|
||||
});
|
||||
|
||||
try {
|
||||
const { nonce, state, playUri } = parse(req.getQuery());
|
||||
if (!state || !nonce) {
|
||||
res.writeStatus("400 Unauthorized").end("missing state and nonce URL parameters");
|
||||
return;
|
||||
throw "missing state and nonce URL parameters";
|
||||
}
|
||||
try {
|
||||
|
||||
const loginUri = await openIDClient.authorizationUrl(
|
||||
state as string,
|
||||
nonce as string,
|
||||
@ -42,6 +42,7 @@ export class AuthenticateController extends BaseController {
|
||||
res.writeHeader("Location", loginUri);
|
||||
return res.end();
|
||||
} catch (e) {
|
||||
console.error("openIDLogin => e", e);
|
||||
return this.errorToResponse(e, res);
|
||||
}
|
||||
});
|
||||
@ -82,6 +83,7 @@ export class AuthenticateController extends BaseController {
|
||||
this.addCorsHeaders(res);
|
||||
return res.end(JSON.stringify({ authToken }));
|
||||
} catch (e) {
|
||||
console.error("openIDCallback => ERROR", e);
|
||||
return this.errorToResponse(e, res);
|
||||
}
|
||||
});
|
||||
@ -152,6 +154,7 @@ export class AuthenticateController extends BaseController {
|
||||
})
|
||||
);
|
||||
} catch (e) {
|
||||
console.error("register => ERROR", e);
|
||||
this.errorToResponse(e, res);
|
||||
}
|
||||
})();
|
||||
@ -213,6 +216,7 @@ export class AuthenticateController extends BaseController {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("profileCallback => ERROR", error);
|
||||
this.errorToResponse(error, res);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user