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: CE recovery

Blue Mouseddd13a867063
diff --git a/web/app/pages/Auth/ForgotPassword/ForgotPassword.tsx b/web/app/pages/Auth/ForgotPassword/ForgotPassword.tsx
index 0644c83be..4c6101425 100644
--- a/web/app/pages/Auth/ForgotPassword/ForgotPassword.tsx
+++ b/web/app/pages/Auth/ForgotPassword/ForgotPassword.tsx
@@ -7,7 +7,7 @@ import { toast } from 'sonner'
import { forgotPassword } from '~/api'
import { withAuthentication, auth } from '~/hoc/protected'
-import { TRIAL_DAYS } from '~/lib/constants'
+import { isSelfhosted, TRIAL_DAYS } from '~/lib/constants'
import Button from '~/ui/Button'
import Input from '~/ui/Input'
import routes from '~/utils/routes'
@@ -107,24 +107,26 @@ const ForgotPassword = () => {
</Button>
</form>
</div>
- <p className='mt-10 mb-4 text-center text-sm text-gray-500 dark:text-gray-200'>
- <Trans
- t={t}
- i18nKey='auth.signin.notAMember'
- components={{
- url: (
- <Link
- to={routes.signup}
- className='leading-6 font-semibold text-indigo-600 hover:underline dark:text-indigo-400'
- aria-label={t('footer.tos')}
- />
- ),
- }}
- values={{
- amount: TRIAL_DAYS,
- }}
- />
- </p>
+ {isSelfhosted ? null : (
+ <p className='mt-10 mb-4 text-center text-sm text-gray-500 dark:text-gray-200'>
+ <Trans
+ t={t}
+ i18nKey='auth.signin.notAMember'
+ components={{
+ url: (
+ <Link
+ to={routes.signup}
+ className='leading-6 font-semibold text-indigo-600 hover:underline dark:text-indigo-400'
+ aria-label={t('footer.tos')}
+ />
+ ),
+ }}
+ values={{
+ amount: TRIAL_DAYS,
+ }}
+ />
+ </p>
+ )}
</div>
</div>
</div>
diff --git a/web/app/pages/Auth/Signin/Signin.tsx b/web/app/pages/Auth/Signin/Signin.tsx
index 15becf609..39eaf23eb 100644
--- a/web/app/pages/Auth/Signin/Signin.tsx
+++ b/web/app/pages/Auth/Signin/Signin.tsx
@@ -328,16 +328,14 @@ const Signin = () => {
name='dontRemember'
label={t('auth.common.noRemember')}
/>
- {!isSelfhosted ? (
- <div className='text-sm leading-6'>
- <Link
- to={routes.reset_password}
- className='font-semibold text-indigo-600 hover:underline dark:text-indigo-400'
- >
- {t('auth.signin.forgot')}
- </Link>
- </div>
- ) : null}
+ <div className='text-sm leading-6'>
+ <Link
+ to={routes.reset_password}
+ className='font-semibold text-indigo-600 hover:underline dark:text-indigo-400'
+ >
+ {t('auth.signin.forgot')}
+ </Link>
+ </div>
</div>
<Button className='w-full justify-center' type='submit' loading={isLoading} primary giant>
diff --git a/web/app/routes/password-reset.$id.tsx b/web/app/routes/password-reset.$id.tsx
index 732587153..7b4b3e1ac 100644
--- a/web/app/routes/password-reset.$id.tsx
+++ b/web/app/routes/password-reset.$id.tsx
@@ -1,8 +1,6 @@
import type { HeadersFunction } from 'react-router'
-import { redirect } from 'react-router'
import type { SitemapFunction } from 'remix-sitemap'
-import { isSelfhosted } from '~/lib/constants'
import CreateNewPassword from '~/pages/Auth/CreateNewPassword'
export const headers: HeadersFunction = ({ parentHeaders }) => {
@@ -14,14 +12,6 @@ export const sitemap: SitemapFunction = () => ({
exclude: true,
})
-export async function loader() {
- if (isSelfhosted) {
- return redirect('/login', 302)
- }
-
- return null
-}
-
export default function Index() {
return <CreateNewPassword />
}
diff --git a/web/app/routes/recovery.tsx b/web/app/routes/recovery.tsx
index dc2b887fc..ee80df904 100644
--- a/web/app/routes/recovery.tsx
+++ b/web/app/routes/recovery.tsx
@@ -1,22 +1,17 @@
import type { HeadersFunction } from 'react-router'
-import { redirect } from 'react-router'
+import { SitemapFunction } from 'remix-sitemap'
-import { isSelfhosted } from '~/lib/constants'
import ForgotPassword from '~/pages/Auth/ForgotPassword'
+export const sitemap: SitemapFunction = () => ({
+ exclude: true,
+})
+
export const headers: HeadersFunction = ({ parentHeaders }) => {
parentHeaders.set('X-Frame-Options', 'DENY')
return parentHeaders
}
-export async function loader() {
- if (isSelfhosted) {
- return redirect('/login', 302)
- }
-
- return null
-}
-
export default function Index() {
return <ForgotPassword />
}