""auth"" working nicely

This commit is contained in:
2025-08-17 19:32:01 -04:00
parent c755b83d3d
commit ef5a5e059a
5 changed files with 44 additions and 42 deletions

View File

@@ -0,0 +1,8 @@
import Elysia from "elysia";
export const human = new Elysia({ name: "human" })
.derive(async ({ cookie: { token }, status }) => {
const humanKey = token.value;
return humanKey != null ? { humanKey } : status(401);
})
.as("scoped");