Fix: ci error - no token sercret

This commit is contained in:
lukeIam 2023-09-16 18:42:48 +00:00
parent 91d8451ab3
commit 7af3033f8d

View File

@ -19,7 +19,7 @@ class Auth {
/**
* Inializes all passportjs stragegies and other passportjs ralated initialization.
*/
initPassportJs() {
async initPassportJs() {
// Check if we should load the local strategy
if (global.ServerSettings.authActiveAuthMethods.includes("local")) {
passport.use(new LocalStrategy(this.localAuthCheckUserPw.bind(this)))
@ -70,6 +70,10 @@ class Auth {
}).bind(this)))
}
if (!global.ServerSettings.tokenSecret) {
await this.initTokenSecret()
}
// Load the JwtStrategy (always) -> for bearer token auth
passport.use(new JwtStrategy({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),