Merge branch 'develop' of github.com:thecodingmachine/workadventure into develop
This commit is contained in:
@@ -79,6 +79,7 @@ export class AuthenticateController extends BaseController {
|
|||||||
if (!code && !nonce) {
|
if (!code && !nonce) {
|
||||||
res.writeStatus("200");
|
res.writeStatus("200");
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
|
res.writeHeader("Content-Type", "application/json");
|
||||||
return res.end(JSON.stringify({ ...resUserData, authToken: token }));
|
return res.end(JSON.stringify({ ...resUserData, authToken: token }));
|
||||||
}
|
}
|
||||||
console.error("Token cannot to be check on OpenId provider");
|
console.error("Token cannot to be check on OpenId provider");
|
||||||
@@ -91,6 +92,7 @@ export class AuthenticateController extends BaseController {
|
|||||||
const resCheckTokenAuth = await openIDClient.checkTokenAuth(authTokenData.accessToken);
|
const resCheckTokenAuth = await openIDClient.checkTokenAuth(authTokenData.accessToken);
|
||||||
res.writeStatus("200");
|
res.writeStatus("200");
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
|
res.writeHeader("Content-Type", "application/json");
|
||||||
return res.end(JSON.stringify({ ...resCheckTokenAuth, ...resUserData, username: authTokenData.username, locale: authTokenData.locale, authToken: token }));
|
return res.end(JSON.stringify({ ...resCheckTokenAuth, ...resUserData, username: authTokenData.username, locale: authTokenData.locale, authToken: token }));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.info("User was not connected", err);
|
console.info("User was not connected", err);
|
||||||
@@ -121,6 +123,7 @@ export class AuthenticateController extends BaseController {
|
|||||||
|
|
||||||
res.writeStatus("200");
|
res.writeStatus("200");
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
|
res.writeHeader("Content-Type", "application/json");
|
||||||
return res.end(JSON.stringify({ ...data, authToken, username: userInfo.username, locale: userInfo.locale, userUuid : sub }));
|
return res.end(JSON.stringify({ ...data, authToken, username: userInfo.username, locale: userInfo.locale, userUuid : sub }));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("openIDCallback => ERROR", e);
|
console.error("openIDCallback => ERROR", e);
|
||||||
@@ -183,6 +186,7 @@ export class AuthenticateController extends BaseController {
|
|||||||
const authToken = jwtTokenManager.createAuthToken(email || userUuid);
|
const authToken = jwtTokenManager.createAuthToken(email || userUuid);
|
||||||
res.writeStatus("200 OK");
|
res.writeStatus("200 OK");
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
|
res.writeHeader("Content-Type", "application/json");
|
||||||
res.end(
|
res.end(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
authToken,
|
authToken,
|
||||||
@@ -222,6 +226,7 @@ export class AuthenticateController extends BaseController {
|
|||||||
const authToken = jwtTokenManager.createAuthToken(userUuid);
|
const authToken = jwtTokenManager.createAuthToken(userUuid);
|
||||||
res.writeStatus("200 OK");
|
res.writeStatus("200 OK");
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
|
res.writeHeader("Content-Type", "application/json");
|
||||||
res.end(
|
res.end(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
authToken,
|
authToken,
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export class MapController extends BaseController {
|
|||||||
if (!match) {
|
if (!match) {
|
||||||
res.writeStatus("404 Not Found");
|
res.writeStatus("404 Not Found");
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
|
res.writeHeader("Content-Type", "application/json");
|
||||||
res.end(JSON.stringify({}));
|
res.end(JSON.stringify({}));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -56,6 +57,7 @@ export class MapController extends BaseController {
|
|||||||
|
|
||||||
res.writeStatus("200 OK");
|
res.writeStatus("200 OK");
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
|
res.writeHeader("Content-Type", "application/json");
|
||||||
res.end(
|
res.end(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
mapUrl,
|
mapUrl,
|
||||||
@@ -107,6 +109,7 @@ export class MapController extends BaseController {
|
|||||||
|
|
||||||
res.writeStatus("200 OK");
|
res.writeStatus("200 OK");
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
|
res.writeHeader("Content-Type", "application/json");
|
||||||
res.end(JSON.stringify(mapDetails));
|
res.end(JSON.stringify(mapDetails));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.errorToResponse(e, res);
|
this.errorToResponse(e, res);
|
||||||
|
|||||||
Reference in New Issue
Block a user