This commit is contained in:
Ludwig Behm 2022-02-16 00:19:55 +01:00
commit 146e8e0dff
20 changed files with 64 additions and 31 deletions

View file

@ -79,7 +79,7 @@ export class AuthenticateController extends BaseController {
if (!code && !nonce) {
res.writeStatus("200");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.writeHeader("Content-Type", "application/json");
return res.end(JSON.stringify({ ...resUserData, authToken: token }));
}
console.error("Token cannot to be check on OpenId provider");
@ -92,7 +92,7 @@ export class AuthenticateController extends BaseController {
const resCheckTokenAuth = await openIDClient.checkTokenAuth(authTokenData.accessToken);
res.writeStatus("200");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.writeHeader("Content-Type", "application/json");
return res.end(JSON.stringify({ ...resCheckTokenAuth, ...resUserData, authToken: token }));
} catch (err) {
console.info("User was not connected", err);
@ -123,7 +123,7 @@ export class AuthenticateController extends BaseController {
res.writeStatus("200");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.writeHeader("Content-Type", "application/json");
return res.end(JSON.stringify({ ...data, authToken }));
} catch (e) {
console.error("openIDCallback => ERROR", e);
@ -186,7 +186,7 @@ export class AuthenticateController extends BaseController {
const authToken = jwtTokenManager.createAuthToken(email || userUuid);
res.writeStatus("200 OK");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.writeHeader("Content-Type", "application/json");
res.end(
JSON.stringify({
authToken,
@ -226,7 +226,7 @@ export class AuthenticateController extends BaseController {
const authToken = jwtTokenManager.createAuthToken(userUuid);
res.writeStatus("200 OK");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.writeHeader("Content-Type", "application/json");
res.end(
JSON.stringify({
authToken,

View file

@ -47,7 +47,7 @@ export class MapController extends BaseController {
if (!match) {
res.writeStatus("404 Not Found");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.writeHeader("Content-Type", "application/json");
res.end(JSON.stringify({}));
return;
}
@ -56,7 +56,7 @@ export class MapController extends BaseController {
res.writeStatus("200 OK");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.writeHeader("Content-Type", "application/json");
res.end(
JSON.stringify({
mapUrl,
@ -108,7 +108,7 @@ export class MapController extends BaseController {
res.writeStatus("200 OK");
this.addCorsHeaders(res);
res.writeHeader('Content-Type', 'application/json');
res.writeHeader("Content-Type", "application/json");
res.end(JSON.stringify(mapDetails));
} catch (e) {
this.errorToResponse(e, res);

View file

@ -950,9 +950,9 @@ flatted@^2.0.0:
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
follow-redirects@^1.14.0:
version "1.14.7"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685"
integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==
version "1.14.8"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc"
integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==
fs-minipass@^2.0.0:
version "2.1.0"