Spaces:
Sleeping
Sleeping
File size: 332 Bytes
18b71c5 | 1 2 3 4 5 6 7 8 9 10 11 | import jwt from "jsonwebtoken";
import { env } from "../config/env";
export const signToken = (userId: string) =>
jwt.sign({ sub: userId }, env.jwtSecret, {
expiresIn: env.jwtExpiresIn as jwt.SignOptions["expiresIn"],
});
export const verifyToken = (token: string) =>
jwt.verify(token, env.jwtSecret) as jwt.JwtPayload;
|