fix: fix.env.example
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
import jwt from "jsonwebtoken";
|
||||
|
||||
export const jwtDecode = (payload: string) => {
|
||||
// return payload;
|
||||
if (!payload) throw "JWT decode payload not found";
|
||||
const JWTKey = process.env.JWT_SECRET!;
|
||||
|
||||
try {
|
||||
const decodedPayload = jwt.verify(payload, JWTKey);
|
||||
return decodedPayload;
|
||||
} catch (error) {
|
||||
throw "JWT expired or not valid";
|
||||
}
|
||||
};
|
||||
import jwt from "jsonwebtoken";
|
||||
|
||||
export const jwtDecode = (payload: string) => {
|
||||
// return payload;
|
||||
if (!payload) throw "JWT decode payload not found";
|
||||
const JWTKey = process.env.JWT_SECRET!;
|
||||
|
||||
try {
|
||||
const decodedPayload = jwt.verify(payload, JWTKey);
|
||||
return decodedPayload;
|
||||
} catch (error) {
|
||||
throw "JWT expired or not valid";
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user