Skip to content

Instantly share code, notes, and snippets.

@bcnzer
bcnzer / cloudflareworker-verifyjwt.js
Last active June 23, 2024 02:02
Sample Cloudflare worker that gets the JWT, ensures it hasn't expired, decrypts it and returns a result
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
// Following code is a modified version of that found at https://blog.cloudflare.com/dronedeploy-and-cloudflare-workers/
/**
* Fetch and log a request
* @param {Request} request
*/