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

jwt has expires

parent 7b00fcea
...@@ -4,7 +4,10 @@ import jwt from "jsonwebtoken"; ...@@ -4,7 +4,10 @@ import jwt from "jsonwebtoken";
* @param {{id: number, name: string, email: string, phone: string, photo: string, username: string }} data * @param {{id: number, name: string, email: string, phone: string, photo: string, username: string }} data
*/ */
export const JwtGenerate = (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; 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