Adding HTTP Query Endpoint and refining some things
This commit is contained in:
12
src/helper/jwt.ts
Normal file
12
src/helper/jwt.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import * as JWT from "jsonwebtoken";
|
||||
|
||||
export async function verifyJWT(token: string, publicKey: string) {
|
||||
return new Promise<any | undefined>((yes) => {
|
||||
JWT.verify(token, publicKey, (err, decoded) => {
|
||||
if (err)
|
||||
yes(undefined);
|
||||
else
|
||||
yes(decoded);
|
||||
})
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user