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!

fix get project

kruzhambus37924eed3310
diff --git a/src/api/index.ts b/src/api/index.ts
index d1315cfd6..226d05024 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -265,7 +265,7 @@ export const getSharedProjects = (take: number = 0, skip: number = 0) =>
export const getProject = (pid: string, isCaptcha: boolean = false, password?: string) =>
api
.get(`/project/${pid}?isCaptcha=${isCaptcha}`, {
- data: {
+ headers: {
password,
},
})
@@ -361,7 +361,7 @@ export const getProjectData = (
.get(
`log?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(filters)}&from=${from}&to=${to}&timezone=${timezone}`,
{
- data: {
+ headers: {
password,
},
},
diff --git a/src/pages/Project/View/ViewProject.tsx b/src/pages/Project/View/ViewProject.tsx
index 264fb0fd0..f19428f6a 100644
--- a/src/pages/Project/View/ViewProject.tsx
+++ b/src/pages/Project/View/ViewProject.tsx
@@ -1347,7 +1347,7 @@ const ViewProject = ({
getProject(id, false, projectPassword)
.then(projectRes => {
if (!_isEmpty(projectRes)) {
- if (projectRes.isPasswordProtected && !projectRes.isOwner && !projectPassword) {
+ if (projectRes.isPasswordProtected && !projectRes.isOwner && _isEmpty(projectPassword)) {
history.push(_replace(routes.project_protected_password, ':id', id))
return
}