Skip to content
Snippets Groups Projects
Commit 2740d1a0 authored by michael.minelli's avatar michael.minelli
Browse files

SessionManager => Remove HttpStatusCode call

parent a355ce83
No related branches found
No related tags found
No related merge requests found
import * as jwt from 'jsonwebtoken';
import User from '../sharedByClients/models/User';
import LocalConfigKeys from '../types/LocalConfigKeys';
import axios, { HttpStatusCode } from 'axios';
import axios from 'axios';
import HttpManager from './HttpManager';
import ora from 'ora';
import Permissions from '../types/Permissions';
......@@ -21,6 +21,7 @@ import { sessionConfigFile } from '../config/ConfigFiles';
import TextStyle from '../types/TextStyle';
import DojoBackendHelper from '../sharedByClients/helpers/Dojo/DojoBackendHelper';
import GitlabManager from './GitlabManager';
import { StatusCodes } from 'http-status-codes';
class LoginServer {
......@@ -31,7 +32,7 @@ class LoginServer {
this.server = http.createServer((req, res) => {
const sendError = (error: string) => {
this.events.emit('error', error);
res.writeHead(HttpStatusCode.InternalServerError, { 'Content-Type': 'text/html' });
res.writeHead(StatusCodes.INTERNAL_SERVER_ERROR, { 'Content-Type': 'text/html' });
res.write(`<html lang="en"><body><h1 style="color: red">DojoCLI login error</h1><h3>Please look at your CLI for more informations.</h3></body></html>`);
res.end();
};
......@@ -39,7 +40,7 @@ class LoginServer {
if ( req.url?.match(Config.login.server.route) ) {
const urlParts = req.url.split('=');
if ( urlParts.length > 0 ) {
res.writeHead(HttpStatusCode.Ok, { 'Content-Type': 'text/html' });
res.writeHead(StatusCodes.OK, { 'Content-Type': 'text/html' });
res.write(`<html lang="en"><body><h1 style="color: green">DojoCLI login successful</h1><h3>You can close this window.</h3></body></html>`);
res.end();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment