From e1c47572a6235fd8fd20af888ac3a11c7ae1369d Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:37:40 -0700 Subject: updates --- config/auth.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'config/auth.ts') diff --git a/config/auth.ts b/config/auth.ts index f43bbdb..a3fcc45 100644 --- a/config/auth.ts +++ b/config/auth.ts @@ -5,9 +5,9 @@ * file. */ -import { AuthConfig } from '@ioc:Adonis/Addons/Auth' -import env from '#start/env' -import { appKey, jwtUsePEM } from './app.js' +import { AuthConfig } from '@ioc:Adonis/Addons/Auth'; +import env from '#start/env'; +import { appKey, jwtUsePEM } from './app.js'; /* |-------------------------------------------------------------------------- @@ -233,8 +233,12 @@ const authConfig: AuthConfig = { driver: 'jwt', secret: jwtUsePEM ? undefined : appKey, algorithmJwt: jwtUsePEM ? undefined : 'HS256', - publicKey: jwtUsePEM ? env.get('JWT_PUBLIC_KEY', '').replaceAll('\\n', '\n') : undefined, - privateKey: jwtUsePEM ? env.get('JWT_PRIVATE_KEY', '').replaceAll('\\n', '\n') : undefined, + publicKey: jwtUsePEM + ? env.get('JWT_PUBLIC_KEY', '').replaceAll('\\n', '\n') + : undefined, + privateKey: jwtUsePEM + ? env.get('JWT_PRIVATE_KEY', '').replaceAll('\\n', '\n') + : undefined, persistJwt: true, // TODO: We should improve the following implementation as this is a security concern. // The following ts-expect-error is to set exp to undefined (JWT with no expiration) @@ -254,6 +258,6 @@ const authConfig: AuthConfig = { }, }, }, -} +}; -export default authConfig +export default authConfig; -- cgit v1.2.3-70-g09d2