Skip to content

Instantly share code, notes, and snippets.

View rickserraglia's full-sized avatar
Focusing

Henrique Serraglia rickserraglia

Focusing
View GitHub Profile
@rickserraglia
rickserraglia / cloudflareworker-verifyjwt.js
Created May 20, 2024 18:38 — forked from bcnzer/cloudflareworker-verifyjwt.js
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
*/