Update inject-permission.ts

This commit is contained in:
Daniel Hougaard
2024-03-17 18:49:30 +01:00
parent 22b2fb4c98
commit 771498b817
@@ -8,10 +8,6 @@ export const injectPermission = fp(async (server) => {
server.addHook("onRequest", async (req) => { server.addHook("onRequest", async (req) => {
if (!req.auth) return; if (!req.auth) return;
// if (!req.auth.authMethod) {
// throw new Error("THIS SHOULD NOT HAPPEN");
// }
if (req.auth.actor === ActorType.USER) { if (req.auth.actor === ActorType.USER) {
req.permission = { req.permission = {
type: ActorType.USER, type: ActorType.USER,