Commit 4e9f67b8 authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

jwt has expires

parent 7b00fcea
......@@ -4,7 +4,10 @@ import jwt from "jsonwebtoken";
* @param {{id: number, name: string, email: string, phone: string, photo: string, username: string }} data
*/
export const JwtGenerate = (data) => {
let token = jwt.sign(data, process.env.JWT_TOKEN, { algorithm: "HS256" });
let token = jwt.sign(data, process.env.JWT_TOKEN, {
algorithm: "HS256",
expiresIn: "2d",
});
return token;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment