Fix token

This commit is contained in:
Anika Raemer 2025-09-24 20:39:33 +02:00
parent db480a88e0
commit 3cc66f4e97
2 changed files with 9 additions and 4 deletions

View file

@ -1,6 +1,6 @@
import * as jwt from "jsonwebtoken";
import * as bcrypt from "bcrypt";
import * as dotenv from "dotenv";
import jwt from "jsonwebtoken";
import bcrypt from "bcrypt";
import dotenv from "dotenv";
dotenv.config();
const { JWT_SECRET = "" } = process.env;
@ -16,4 +16,8 @@ export class encrypt {
// @todo currently, we have an error here!
return jwt.sign(payload, JWT_SECRET, { expiresIn: "1d" });
}
}
static verifyToken(token: string) {
return jwt.verify(token, JWT_SECRET);
}
}