diff --git a/scripts/authelia-scripts-start b/scripts/authelia-scripts-start index f28cc635d..b6a5d05b3 100755 --- a/scripts/authelia-scripts-start +++ b/scripts/authelia-scripts-start @@ -44,9 +44,12 @@ function startServer() { console.log('Authelia is interrupted. Consider removing ' + AUTHELIA_INTERRUPT_FILENAME + ' if it\'s not expected.'); return; } - serverProcess = spawn('./scripts/run-dev-server.sh', [`test/suites/${program.suite}/config.yml`]); - serverProcess.stdout.pipe(process.stdout); - serverProcess.stderr.pipe(process.stderr); + exec('./node_modules/.bin/tslint', ['-c', 'server/tslint.json', '-p', 'server/tsconfig.json']) + .then(function() { + serverProcess = spawn('./scripts/run-dev-server.sh', [`test/suites/${program.suite}/config.yml`]); + serverProcess.stdout.pipe(process.stdout); + serverProcess.stderr.pipe(process.stderr); + }); } let clientProcess; @@ -97,7 +100,8 @@ function killClient(onExit) { } function generateConfigurationSchema() { - exec('./node_modules/.bin/typescript-json-schema -o server/src/lib/configuration/Configuration.schema.json --strictNullChecks --required server/tsconfig.json Configuration'); + return ixec('./node_modules/.bin/typescript-json-schema', + ['-o', 'server/src/lib/configuration/Configuration.schema.json', '--strictNullChecks', '--required', 'server/tsconfig.json', 'Configuration']); } function reload(path) { diff --git a/server/src/lib/authentication/AuthenticationError.ts b/server/src/lib/authentication/AuthenticationError.ts index 8203b345a..9285ac49c 100644 --- a/server/src/lib/authentication/AuthenticationError.ts +++ b/server/src/lib/authentication/AuthenticationError.ts @@ -8,4 +8,4 @@ class AuthenticationError extends Error { } } -export default AuthenticationError \ No newline at end of file +export default AuthenticationError; \ No newline at end of file diff --git a/server/src/lib/routes/firstfactor/post.ts b/server/src/lib/routes/firstfactor/post.ts index 2a2671d4a..f6ec8a661 100644 --- a/server/src/lib/routes/firstfactor/post.ts +++ b/server/src/lib/routes/firstfactor/post.ts @@ -63,8 +63,8 @@ export default function (vars: ServerVariables) { vars.regulator.mark(username, true); }) .then(function() { - const targetUrl = ObjectPath.get(req, 'headers.x-target-url', null); - + const targetUrl = ObjectPath.get(req, "headers.x-target-url", undefined); + if (!targetUrl) { res.status(204); res.send(); @@ -76,12 +76,12 @@ export default function (vars: ServerVariables) { const resObject: Object = { domain: resource.domain, resource: resource.path, - } + }; const subject: Subject = { user: authSession.userid, groups: authSession.groups - } + }; const authorizationLevel = vars.authorizer.authorization(resObject, subject); if (authorizationLevel <= AuthorizationLevel.ONE_FACTOR) {