Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(users): Fix wrong redirection url in magic link (#3217)

Mani Chandra000e64438838
diff --git a/crates/router/src/services/email/types.rs b/crates/router/src/services/email/types.rs
index 9e26c45ba6..d5c28b1fd6 100644
--- a/crates/router/src/services/email/types.rs
+++ b/crates/router/src/services/email/types.rs
@@ -77,7 +77,7 @@ pub fn get_link_with_token(
token: impl std::fmt::Display,
action: impl std::fmt::Display,
) -> String {
- format!("{base_url}/user/{action}/?token={token}")
+ format!("{base_url}/user/{action}?token={token}")
}
pub struct VerifyEmail {
@@ -153,7 +153,8 @@ impl EmailData for MagicLink {
.await
.change_context(EmailError::TokenGenerationFailure)?;
- let magic_link_login = get_link_with_token(&self.settings.email.base_url, token, "login");
+ let magic_link_login =
+ get_link_with_token(&self.settings.email.base_url, token, "verify_email");
let body = html::get_html_body(EmailBody::MagicLink {
link: magic_link_login,