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!

Indicate that a recovery email has been sent

Blue Moused868492121e0
diff --git a/web/app/pages/Auth/ForgotPassword/ForgotPassword.tsx b/web/app/pages/Auth/ForgotPassword/ForgotPassword.tsx
index 46c5f7c6d..897f084b1 100644
--- a/web/app/pages/Auth/ForgotPassword/ForgotPassword.tsx
+++ b/web/app/pages/Auth/ForgotPassword/ForgotPassword.tsx
@@ -20,15 +20,18 @@ const ForgotPassword = () => {
const { t } = useTranslation('common')
const navigation = useNavigation()
const actionData = useActionData<ForgotPasswordActionData>()
- const [searchParams] = useSearchParams()
+ const [searchParams, setSearchParams] = useSearchParams()
const isSubmitting = navigation.state === 'submitting'
useEffect(() => {
if (searchParams.get('password_reset_sent') === 'true') {
toast.success(t('auth.forgot.sent'))
+ const nextSearchParams = new URLSearchParams(searchParams)
+ nextSearchParams.delete('password_reset_sent')
+ setSearchParams(nextSearchParams, { replace: true })
}
- }, [searchParams, t])
+ }, [searchParams, setSearchParams, t])
useEffect(() => {
if (actionData?.error) {
diff --git a/web/app/routes/recovery.tsx b/web/app/routes/recovery.tsx
index 992f873cb..43d9a11a1 100644
--- a/web/app/routes/recovery.tsx
+++ b/web/app/routes/recovery.tsx
@@ -11,6 +11,7 @@ import { SitemapFunction } from 'remix-sitemap'
import { getAuthenticatedUser, serverFetch } from '~/api/api.server'
import { getOgImageUrl } from '~/lib/constants'
import ForgotPassword from '~/pages/Auth/ForgotPassword'
+import routes from '~/utils/routes'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
import { isValidEmail } from '~/utils/validator'
@@ -82,7 +83,7 @@ export async function action({ request }: ActionFunctionArgs) {
)
}
- return redirect('/?password_reset_sent=true')
+ return redirect(`${routes.reset_password}?password_reset_sent=true`)
}
export default function Index() {
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index bcc27c06b..cb7eb9691 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -721,7 +721,7 @@
"updated": "Your password has been updated"
},
"forgot": {
- "sent": "A password reset e-mail has been sent to the specified address",
+ "sent": "If an account exists for that email address, you'll receive password reset instructions shortly.",
"reset": "Reset password"
},
"signin": {