Back

[SOLVED] Password Recovery Emails Not Sending in Production (Works on Localhost)

  • 0
  • Auth
  • Web
Kenny
7 Jan, 2025, 22:29

Like what I've got here

TL;DR
Password recovery emails not sending in production but working on localhost. Solution involved adding the production domain to Appwrite's Domain Whitelist. The issue was related to the URL host not being accepted.
JP
7 Jan, 2025, 22:29

yes, one sek

JP
7 Jan, 2025, 22:33
JP
7 Jan, 2025, 22:34

I'm not entirely sure which other images you're looking for besides thees ones.

Kenny
7 Jan, 2025, 22:36

Sure, I think I know the issue. On the overview page of your project, scroll towards the bottom. You should see a header for integrations and a pink button that says add platform. Click that button, then click web app, fill out this form putting the domain of your web application in. This should whitelist your domain.

Kenny
7 Jan, 2025, 22:37

I believe this is a security measure to prevent people from highjacking recovery tokens or something

Kenny
7 Jan, 2025, 22:37

It also is what prevents CORS errors if you didn't setup your own subdomain for appwrite

Kenny
7 Jan, 2025, 22:38

Please note that in order to avoid a Redirect Attack the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.

https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery

JP
7 Jan, 2025, 22:40

Tbh, i dont see the header "integrations" under overview.

JP
7 Jan, 2025, 22:40

it is in appwrite, right?

JP
7 Jan, 2025, 22:41

nvm, i found it

JP
7 Jan, 2025, 22:41

sorry

Kenny
7 Jan, 2025, 22:41

My bad, I think the UI changes when you add one

Kenny
7 Jan, 2025, 22:42

After you add a platform the UI for adding one changes lol, I was referencing that. Going to add this just incase someone else has the same issue and finds this support post.

JP
7 Jan, 2025, 22:44

Thanks, you are a big help.

Kenny
7 Jan, 2025, 22:44

Did that work out for you?

JP
7 Jan, 2025, 22:45

can i ask you to be sure, what should i put as Hostname and Name?

Kenny
7 Jan, 2025, 22:46

Name is purely vanity for you to know what it's for, for hostname you would put the domain of your app leaving out the http(s)://

So for example, if I have the website https://kennethbass.com, and want to add it I would put kennethbass.com in the hostname.

JP
7 Jan, 2025, 22:46

should i use my base url ad the hostname or the appwrite CNAME i mead?

Kenny
7 Jan, 2025, 22:47

Or if I had a subdomain of https://cdn.kennethbass.com, I could do cdn.kennethbass.com or *.kennethbass.com. The wildcard allows any subdomain on my main domain to be whitelisted, this is fine if you own the domain, but if you're using something like vercel.app then you probably don't want to do that because you've now just whitelisted any vercel.app domain on your appwrite instance.

Kenny
7 Jan, 2025, 22:47

base url

JP
7 Jan, 2025, 22:48

perfect! it works now

JP
7 Jan, 2025, 22:48

thank you so much

Kenny
7 Jan, 2025, 22:49

Awesome!

Kenny
7 Jan, 2025, 22:49

[SOLVED] Password Recovery Emails Not Sending in Production (Works on Localhost)

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more