Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

add new endpoint

kruzhambus0a951d3f679e
diff --git a/apps/production/src/project/project.controller.ts b/apps/production/src/project/project.controller.ts
index fe85977cd..9a10b1caf 100644
--- a/apps/production/src/project/project.controller.ts
+++ b/apps/production/src/project/project.controller.ts
@@ -975,6 +975,27 @@ export class ProjectController {
})
}
+ @Get('password/:projectId')
+ @Auth([], true, true)
+ @ApiResponse({ status: 200, type: Project })
+ async checkPassword(
+ @Param('projectId') projectId: string,
+ @CurrentUserId() userId: string,
+ @Body() body: ProjectPasswordDto,
+ ): Promise<Boolean> {
+ this.logger.log({ projectId }, 'GET /project/password/:projectId')
+
+ const project = await this.projectService.getProjectById(projectId)
+
+ if (!project) {
+ throw new NotFoundException('Project not found.')
+ }
+
+ this.projectService.allowedToView(project, userId, body.passwordHash)
+
+ return true
+ }
+
@Get(':projectId/subscribers/invite')
@HttpCode(HttpStatus.OK)
async confirmSubscriberInvite(