""auth"" working nicely
This commit is contained in:
8
packages/server/src/human.ts
Normal file
8
packages/server/src/human.ts
Normal 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");
|
||||
Reference in New Issue
Block a user