moved auth ctx to request context, cleaned up system controller

This commit is contained in:
dswbx
2025-02-14 20:32:09 +01:00
parent fb76f8d789
commit 21a8f56c48
10 changed files with 131 additions and 166 deletions

View File

@@ -104,10 +104,9 @@ export class AuthController extends Controller {
}
hono.get("/me", auth(), async (c) => {
if (this.auth.authenticator.isUserLoggedIn()) {
const claims = this.auth.authenticator.getUser()!;
const claims = c.get("auth")?.user;
if (claims) {
const { data: user } = await this.userRepo.findId(claims.id);
return c.json({ user });
}