This repository has been archived on 2021-06-02. You can view files and clone it, but cannot push or open issues or pull requests.
Files
RealtimeDB-OLD/src/helper/jwt.ts
2019-11-15 16:36:42 +01:00

12 lines
313 B
TypeScript

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);
})
})
}