Public
Script
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

Minimal Auth Middleware

Usage

import { auth } from "https://esm.town/v/pomdtr/auth"; export default auth(req => Response.json({message: "You are logged in!"}));
1
2
3
4
5
6
7
8
import { lastlogin } from "https://esm.town/v/pomdtr/lastlogin";
import { verifyUserEmail } from "https://esm.town/v/pomdtr/verifyUserEmail";
export const auth = (next: (req: Request) => Response | Promise<Response>) => {
return lastlogin(next, {
verifyEmail: verifyUserEmail,
});
};
August 8, 2024