Skip to content

Instantly share code, notes, and snippets.

@harveyconnor
Created August 10, 2020 05:55
Show Gist options
  • Save harveyconnor/eaadcb5e465a96e4211aa562541231a8 to your computer and use it in GitHub Desktop.
Save harveyconnor/eaadcb5e465a96e4211aa562541231a8 to your computer and use it in GitHub Desktop.
Async JWT Verify for TypeScript/JS
export async function jwtVerify(token: string, secret: string): Promise<any> {
return new Promise((resolve, reject) => {
verify(token, secret, (err, decoded) => {
if (err) return reject(err);
resolve(decoded);
});
});
}
@loicDev1
Copy link

Good ! usefull.

@alangabrielbs
Copy link

Nice! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment