feat: add cerbos access control
This commit is contained in:
@@ -3,8 +3,8 @@ import { session } from "@spec/schemas/auth/routes.ts";
|
||||
|
||||
import { getAccountById } from "~stores/read-store/methods.ts";
|
||||
|
||||
export default session.access("session").handle(async ({ accountId }) => {
|
||||
const account = await getAccountById(accountId);
|
||||
export default session.access("authenticated").handle(async ({ principal }) => {
|
||||
const account = await getAccountById(principal.id);
|
||||
if (account === undefined) {
|
||||
return new UnauthorizedError();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user