omgebouwd naar adonisjs, werkt nog niet echt goed

This commit is contained in:
Daan Meijer committed 2026-06-03 23:41:09 +02:00
1 parent dfd3336447
commit 62f1767df3
89 files changed
+9892 -1174

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import type { HttpContext } from '@adonisjs/core/http'
import type { NextFn } from '@adonisjs/core/types/http'
import type { Authenticators } from '@adonisjs/auth/types'
/**
* Auth middleware is used authenticate HTTP requests and deny
* access to unauthenticated users.
*/
export default class AuthMiddleware {
async handle(
ctx: HttpContext,
next: NextFn,
options: {
guards?: (keyof Authenticators)[]
} = {}
) {
await ctx.auth.authenticateUsing(options.guards)
return next()
}
}