chore: move orgRole back to session

This commit is contained in:
Rotimi Best
2026-05-20 15:58:43 +01:00
parent 4e52a618e5
commit cbf1218186
8 changed files with 197 additions and 51 deletions
+3
View File
@@ -53,6 +53,7 @@ export const app = new Hono()
if (isPublicCorsPath(c.req.path)) {
c.set('user', null);
c.set('session', null);
c.set('orgRoles', {});
return next();
}
@@ -68,6 +69,7 @@ export const app = new Hono()
if (!session) {
c.set('user', null);
c.set('session', null);
c.set('orgRoles', {});
await next();
return;
@@ -75,6 +77,7 @@ export const app = new Hono()
c.set('user', session.user);
c.set('session', session.session);
c.set('orgRoles', (session as { orgRoles?: Record<string, number> }).orgRoles ?? {});
await next();
})