1
2
3
4
5
6
7
8
9
10
11
12
import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth";
import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
function handler(req: Request) {
return new Response("You are authenticated!");
}
export default basicAuth(handler, {
verifyUser: (user, password) => {
return user === "admin" && password == "secret"
}
});