feat: authentication
This commit is contained in:
7
server/middleware/auth.ts
Normal file
7
server/middleware/auth.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export default defineEventHandler(async (event) => {
|
||||
const path = getRequestURL(event).pathname;
|
||||
|
||||
if (path.startsWith("/api/") && !path.startsWith("/api/auth/")) {
|
||||
await requireUserSession(event);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user