mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-14 11:25:02 +02:00
Update jwt secret handling
This commit is contained in:
parent
d0d152c20d
commit
8775e55762
6 changed files with 39 additions and 40 deletions
|
@ -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
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue