0f7af70b90
Updated Docker configuration, refactored middleware for improved error handling, and restructured account, order, plan, profile, and support modules, including their routes, services, and validations. Enhanced email processing queues and utilities for token generation, pagination, and response management to streamline the application architecture and enhance maintainability.
16 lines
370 B
JavaScript
16 lines
370 B
JavaScript
import jwt from "jsonwebtoken";
|
|
const generateToken = (payload, secret, expiresIn) => {
|
|
const token = jwt.sign(payload, secret, {
|
|
algorithm: "HS256",
|
|
expiresIn: expiresIn,
|
|
});
|
|
return token;
|
|
};
|
|
const verifyToken = (token, secret) => {
|
|
return jwt.verify(token, secret);
|
|
};
|
|
export const jwtHelpers = {
|
|
generateToken,
|
|
verifyToken,
|
|
};
|