From 1d0f588d6236acaed034e77855a8bd646ba3fd0e Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 6 Dec 2023 18:39:25 +0000 Subject: [PATCH] Use path and url helpers for password links --- app/mailers/user_mailer.rb | 3 +-- app/views/sessions/new.html.erb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 89f8dfdbf..8ca186aad 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -34,8 +34,7 @@ class UserMailer < ApplicationMailer def lost_password(user, token) with_recipient_locale user do - @url = url_for(:controller => "passwords", :action => "reset_password", - :token => token.token) + @url = user_reset_password_url(:token => token.token) mail :to => user.email, :subject => t(".subject") diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 03755730b..3bf4cde5f 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -13,7 +13,7 @@ <%= hidden_field_tag("referer", h(params[:referer]), :autocomplete => "off") %> <%= f.text_field :username, :label => t(".email or username"), :tabindex => 1, :value => params[:username] %> - <%= f.password_field :password, :label => t(".password"), :tabindex => 2, :value => "", :help => link_to(t(".lost password link"), :controller => "passwords", :action => "lost_password") %> + <%= f.password_field :password, :label => t(".password"), :tabindex => 2, :value => "", :help => link_to(t(".lost password link"), user_forgot_password_path) %> <%= f.form_group do %> <%= f.check_box :remember_me, { :label => t(".remember"), :tabindex => 3, :checked => (params[:remember_me] == "yes") }, "yes" %> <% end %> -- 2.39.5