Check linting issues on hotreload and fix remaining ones.

This commit is contained in:
Clement Michaud 2019-02-13 23:31:41 +01:00
parent 29e2799021
commit 85d3adc3e3
3 changed files with 13 additions and 9 deletions

View File

@ -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) {

View File

@ -8,4 +8,4 @@ class AuthenticationError extends Error {
}
}
export default AuthenticationError
export default AuthenticationError;

View File

@ -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) {