Adding HTTP Query Endpoint and refining some things

This commit is contained in:
Fabian Stamm
2019-11-15 16:36:42 +01:00
parent 4cee0048f5
commit d2621fdd3c
6 changed files with 163 additions and 87 deletions

12
src/helper/jwt.ts Normal file
View 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);
})
})
}