test: add keys folder
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
import { PassportStrategy } from "@nestjs/passport";
|
||||
@@ -12,7 +14,9 @@ export class JwtStrategy extends PassportStrategy(Strategy, JWT_STRATEGY_NAME) {
|
||||
super({
|
||||
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
||||
ignoreExpiration: false,
|
||||
secretOrKey: configService.getOrThrow<string>("JWT_SECRET_KEY"),
|
||||
secretOrKey: readFileSync(`${process.cwd()}/keys/public.pem`, "utf8"),
|
||||
algorithms: ["RS256"],
|
||||
issuer: configService.getOrThrow<string>("JWT_ISSUER"),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user