FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Fixing Incorrect Magic Link Domain in FusionAuth Emails

    Scheduled Pinned Locked Moved Solved
    Frequently Asked Questions (FAQ)
    login
    1
    2
    13.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      wesley
      last edited by

      I’m just starting to work with Magic Links in FusionAuth.

      Our FusionAuth service is hosted at company.fusionauth.io, but the Magic Link being generated contains localhost:9011 as the domain.

      Is there a configuration setting I’m missing?

      W 1 Reply Last reply Reply Quote 0
      • W
        wesley @wesley
        last edited by

        This behavior is due to FusionAuth’s default settings for email templates. The Magic Link URL is template-driven, and by default, it may reference a local development environment unless explicitly configured.

        How to Fix This:

        1. Customize the Magic Link URL in Email Templates

          • FusionAuth allows you to update the email template directly.
          • You may want to use the FusionAuth CLI and version control to manage email templates.
          • Refer to the note in this documentation for details:
            Email Templates & Replacement Variables
        2. Update the Tenant Configuration

          • If you want to avoid changes to the email templates, you can put the link in the tenant object and have your template pull from there. To ensure Magic Links point to the correct domain (auth.example.com), update your tenant’s data object using the Tenant API:
            Update a Tenant API
          • This API allows you to populate the tenant.data object.
          • Then you can use it in your email templates.

        Summary

        • Magic Links use email templates, which may default to localhost:9011.
        • Updating tenant settings allows you to set the correct domain dynamically.
        • Use the Tenant API to configure the Magic Link domain properly.
        1 Reply Last reply Reply Quote 0
        • W wesley has marked this topic as solved on
        • mark.robustelliM mark.robustelli moved this topic from Q&A on
        • First post
          Last post