📈 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
some update
kruzhambus3f570ed788e3
diff --git a/src/api/index.ts b/src/api/index.tsindex 4bc8c9e4b..9ee28597e 100644--- a/src/api/index.ts+++ b/src/api/index.ts@@ -995,5 +995,7 @@ export const checkPassword = (pid: string, password: string) =>.then((response): Boolean => response.data).catch((error) => {debug('%s', error)- console.log(error)+ throw _isEmpty(error.response.data?.message)+ ? error.response.data+ : error.response.data.message})diff --git a/src/pages/Project/ProjectProtectedPassword/index.tsx b/src/pages/Project/ProjectProtectedPassword/index.tsxindex e16b2198d..9c14b8c4b 100644--- a/src/pages/Project/ProjectProtectedPassword/index.tsx+++ b/src/pages/Project/ProjectProtectedPassword/index.tsx@@ -5,6 +5,7 @@ import { useTranslation, Trans } from 'react-i18next'import _keys from 'lodash/keys'import _isEmpty from 'lodash/isEmpty'import _isString from 'lodash/isString'+import _replace from 'lodash/replace'import Title from 'components/Title'import { withAuthentication, auth } from 'hoc/protected'@@ -15,8 +16,9 @@ import Checkbox from 'ui/Checkbox'import {isValidEmail, isValidPassword, MIN_PASSWORD_CHARS,} from 'utils/validator'-import { isSelfhosted } from 'redux/constants'+import { PROJECTS_PROTECTED, isSelfhosted } from 'redux/constants'import { checkPassword, submit2FA } from 'api'+import { setItem } from 'utils/localstorage'import { setAccessToken, removeAccessToken } from 'utils/accessToken'import { setRefreshToken, removeRefreshToken } from 'utils/refreshToken'@@ -72,13 +74,17 @@ const ProjectProtectedPassword = (): JSX.Element => {setIsLoading(true)await checkPassword(id, data.password).then((res) => {- console.log(res)- })- .catch(() => {+ if (res) {+ setItem(PROJECTS_PROTECTED, data.password)+ history.push(_replace(routes.project, { id }))+ }setErrors({password: t('auth.common.wrongPassword'),})})+ .catch((err) => {+ console.log(err)+ }).finally(() => {setIsLoading(false)})diff --git a/src/redux/constants/index.ts b/src/redux/constants/index.tsindex 06aa8473c..0bac3368b 100644--- a/src/redux/constants/index.ts+++ b/src/redux/constants/index.ts@@ -244,7 +244,7 @@ export const REFRESH_TOKEN: string = 'refresh_token'// LocalStorageexport const PAGE_FORCE_REFRESHED = 'page-force-refreshed'-+export const PROJECTS_PROTECTED = 'projects_protected'export const PROJECTS_PROTECTED_PASSWORD: string = 'projects_protected_password'export const IS_ACTIVE_COMPARE = 'is-active-compare'