Update jwt secret handling
Some checks are pending
Run Component Tests / Run Component Tests (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run

This commit is contained in:
advplyr 2025-07-08 16:39:50 -05:00
parent d0d152c20d
commit 8775e55762
6 changed files with 39 additions and 40 deletions

View file

@ -63,13 +63,6 @@ class Auth {
return passport.authenticate('jwt', { session: false })(req, res, next)
}
/**
* Generate a token which is used to encrpt/protect the jwts.
*/
async initTokenSecret() {
return this.tokenManager.initTokenSecret()
}
/**
* Function to generate a jwt token for a given user
* TODO: Old method with no expiration
@ -132,7 +125,7 @@ class Auth {
new JwtStrategy(
{
jwtFromRequest: ExtractJwt.fromExtractors([ExtractJwt.fromAuthHeaderAsBearerToken(), ExtractJwt.fromUrlQueryParameter('token')]),
secretOrKey: Database.serverSettings.tokenSecret,
secretOrKey: TokenManager.TokenSecret,
// Handle expiration manaully in order to disable api keys that are expired
ignoreExpiration: true
},