Add a JWT token authentication

This commit is contained in:
Olivier MICHAUD
2021-05-17 21:46:55 +02:00
parent 3c06736520
commit 1371d03fec
5 changed files with 200 additions and 4 deletions
+5
View File
@@ -35,6 +35,10 @@ const argv = optimist
default: null,
describe: 'will bind incoming connections only on ports in range xxx:xxxx'
})
.options('jwt-shared-secret', {
default: null,
describe: 'JWT shared secret used to encode tokens'
})
.argv;
if (argv.help) {
@@ -47,6 +51,7 @@ const server = CreateServer({
secure: argv.secure,
domain: argv.domain,
range: argv.range,
jwt_shared_secret: argv['jwt-shared-secret']
});
server.listen(argv.port, argv.address, () => {