summary refs log tree commit diff
path: root/src/routes/auth
diff options
context:
space:
mode:
authorDiego Magdaleno <diegomagdaleno@protonmail.com>2021-05-22 18:51:46 -0500
committerDiego Magdaleno <diegomagdaleno@protonmail.com>2021-05-22 18:51:46 -0500
commitff7985ad7d214cd2c7b5c2341aaa878edc826d20 (patch)
tree6dde0f5357c25ea5c4f279f81b903d3b2386f6c3 /src/routes/auth
parentFix merge issues, update to reflect config changes and package.json (diff)
downloadserver-ff7985ad7d214cd2c7b5c2341aaa878edc826d20.tar.xz
Config: Final config additons, now everything should work as desired
Diffstat (limited to 'src/routes/auth')
-rw-r--r--src/routes/auth/login.ts4
-rw-r--r--src/routes/auth/register.ts2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/routes/auth/login.ts b/src/routes/auth/login.ts

index 1938b794..275f78c6 100644 --- a/src/routes/auth/login.ts +++ b/src/routes/auth/login.ts
@@ -27,7 +27,7 @@ router.post( // TODO: Rewrite this to have the proper config syntax on the new method - const config = Config.apiConfig.getAll(); + const config = Config.apiConfig.getAll() as Config.DefaultOptions; if (config.login.requireCaptcha && config.security.captcha.enabled) { if (!captcha_key) { @@ -71,7 +71,7 @@ export async function generateToken(id: string) { return new Promise((res, rej) => { jwt.sign( { id: id, iat }, - Config.apiConfig.getAll().security.jwtSecret, + (Config.apiConfig.getAll() as Config.DefaultOptions).security.jwtSecret, { algorithm, }, diff --git a/src/routes/auth/register.ts b/src/routes/auth/register.ts
index ca6351fa..b52b5cf3 100644 --- a/src/routes/auth/register.ts +++ b/src/routes/auth/register.ts
@@ -52,7 +52,7 @@ router.post( let discriminator = ""; // get register Config - const { register, security } = Config.apiConfig.getAll(); + const { register, security } = Config.apiConfig.getAll() as Config.DefaultOptions; // check if registration is allowed if (!register.allowNewRegistration) {