Skip to main content

Magic links use old custom domain name

After updating their custom domain, some users reported an error that caused the verification emails to come with magic links generated for the old domain.

This means that after changing the custom domain from old.production.com to new-domain.production.com, some verification emails still use old.production.com to generate magic links for the verification flow.

This results in emails that contain https://old.production.com/self-service/verification?code={...} instead of https://new-domain.production.com/self-service/verification?code={...}.

To fix this error, run this Ory CLI command to force Ory Network to update the /selfservice/methods/link/config/base_url configuration key:

ory patch identity-config {your-project-id} \
--remove '/selfservice/methods/link/config/base_url'

When you run this command, the /selfservice/methods/link/config/base_url updates automatically to use your current custom domain.

tip

Ory recommends using the "one-time code" verification method. Read this document to learn more.