Add admin portal

This commit is contained in:
Jose Selesan
2026-06-10 09:39:20 -03:00
parent c278c78e3d
commit c1c2f18471
50 changed files with 2713 additions and 69 deletions

View File

@@ -11,6 +11,18 @@ export const requireAuth = createMiddleware<AppEnv>(async (c, next) => {
return c.json({ message: 'Unauthorized' }, 401);
}
const user = session.user as { banned?: boolean; banReason?: string | null };
if (user.banned) {
return c.json(
{
message: 'Tu cuenta ha sido bloqueada.',
...(user.banReason ? { reason: user.banReason } : {}),
},
403
);
}
c.set('user', session.user);
c.set('session', session.session);