Skip to content

Conversation

@AnthonyMichaelTDM
Copy link

This pull request introduces a new configuration option to control whether the server port should be included in the generated server URL for mailers and such.
The default value for this field is true, which will mimic the previous behavior

@AnthonyMichaelTDM
Copy link
Author

I was going to open an issue for this but I figured a PR would be easier for everyone involved

@kaplanelad
Copy link
Contributor

Hey @AnthonyMichaelTDM, can you explain why do you need it?

@AnthonyMichaelTDM
Copy link
Author

To avoid including invalid URLs in auth emails in production.

@AnthonyMichaelTDM
Copy link
Author

AnthonyMichaelTDM commented Dec 18, 2025

Like, in dev I want https://localhost:8080, but in production https://example.com:8080 is incorrect in most cases

I've been using

pub fn domain(ctx: &loco_rs::app::AppContext) -> String {
    match ctx.environment {
        loco_rs::environment::Environment::Production => ctx.config.server.host.clone(),
        _ => ctx.config.server.full_url(),
    }
}

As a workaround so this is more of a convenience thing than anything else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants