jwt middleware
This commit is contained in:
11
backend/app/src/api/protected.ts
Normal file
11
backend/app/src/api/protected.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Elysia } from "elysia";
|
||||
import { authGuard, jwtConfig } from "../auth/index";
|
||||
|
||||
export const protectedApi = new Elysia()
|
||||
.use(jwtConfig)
|
||||
.guard(authGuard, (router) =>
|
||||
router
|
||||
.get("/secret", () => {
|
||||
return "hehe secret";
|
||||
})
|
||||
)
|
||||
Reference in New Issue
Block a user