Skip to content

Instantly share code, notes, and snippets.

@ksodano
ksodano / worker.js
Created December 10, 2022 15:04 — forked from bcnzer/worker.js
Cloudflare Worker that uses Workers KV to get Authorization data. All authentication and authorization is done on the edge
addEventListener('fetch', event => {
event.respondWith(handleRequest(event))
})
/**
* Entry point of the worker
*/
async function handleRequest(event) {
try {
// Get the JWT