mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-18 13:15:39 +00:00
Make some notifications be scoped to certain orgs to prevent redirect
issues.
This commit is contained in:
@@ -26,7 +26,10 @@ export const registerNotificationRouter = async (server: FastifyZodProvider) =>
|
||||
throw new UnauthorizedError({ message: "This endpoint can only be accessed by users" });
|
||||
}
|
||||
|
||||
const notifications = await server.services.notification.listUserNotifications({ userId: req.auth.userId });
|
||||
const notifications = await server.services.notification.listUserNotifications({
|
||||
userId: req.auth.userId,
|
||||
orgId: req.auth.orgId
|
||||
});
|
||||
|
||||
return { notifications };
|
||||
}
|
||||
@@ -111,7 +114,10 @@ export const registerNotificationRouter = async (server: FastifyZodProvider) =>
|
||||
throw new UnauthorizedError({ message: "This endpoint can only be accessed by users" });
|
||||
}
|
||||
|
||||
await server.services.notification.markUserNotificationsAsRead({ userId: req.auth.userId });
|
||||
await server.services.notification.markUserNotificationsAsRead({
|
||||
userId: req.auth.userId,
|
||||
orgId: req.auth.orgId
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user