Introduced Secrets Manager
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { FastifyInstance } from "fastify";
|
||||
import fp from "fastify-plugin";
|
||||
import jwt from "jsonwebtoken";
|
||||
import {secrets} from "../utils/secrets";
|
||||
|
||||
export default fp(async (server: FastifyInstance) => {
|
||||
server.addHook("preHandler", async (req, reply) => {
|
||||
@@ -28,7 +29,7 @@ export default fp(async (server: FastifyInstance) => {
|
||||
}
|
||||
|
||||
|
||||
const payload = jwt.verify(token, process.env.JWT_SECRET!) as {
|
||||
const payload = jwt.verify(token, secrets.JWT_SECRET!) as {
|
||||
user_id: string;
|
||||
email: string;
|
||||
tenant_id?: string;
|
||||
|
||||
Reference in New Issue
Block a user