diff options
author | Vinnie Okada <vokada@mrvinn.com> | 2015-05-13 21:57:16 -0600 |
---|---|---|
committer | Vinnie Okada <vokada@mrvinn.com> | 2015-05-16 14:03:18 -0600 |
commit | af428b12598f06073327bc63d75d9c358c95067a (patch) | |
tree | e82cb1b3cb69652dfc4746102db27e20a5c4b01b /app | |
parent | c68c23210bdf9f0d7212fa55e7bef71ac0f87bcf (diff) | |
download | gitlab-ce-af428b12598f06073327bc63d75d9c358c95067a.tar.gz |
Fill in email on the new password form
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/passwords_controller.rb | 2 | ||||
-rw-r--r-- | app/helpers/emails_helper.rb | 2 | ||||
-rw-r--r-- | app/views/devise/passwords/new.html.haml | 2 | ||||
-rw-r--r-- | app/views/notify/new_user_email.html.haml | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index fbb9d371a79..145f27b67dd 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -52,7 +52,7 @@ class PasswordsController < Devise::PasswordsController unless user.reset_password_period_valid? flash[:alert] = 'Your password reset token has expired.' - redirect_to(new_user_password_url) + redirect_to(new_user_password_url(user_email: user['email'])) end end end diff --git a/app/helpers/emails_helper.rb b/app/helpers/emails_helper.rb index 12aa561a14e..128de18bc47 100644 --- a/app/helpers/emails_helper.rb +++ b/app/helpers/emails_helper.rb @@ -50,7 +50,7 @@ module EmailsHelper end def reset_token_expire_message - link_tag = link_to('request a new one', new_user_password_url) + link_tag = link_to('request a new one', new_user_password_url(user_email: @user.email)) msg = "This link is valid for #{password_reset_token_valid_time}. " msg << "After it expires, you can #{link_tag}." end diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index e8820daf58f..29ffe8a8be3 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -6,7 +6,7 @@ .devise-errors = devise_error_messages! .clearfix.append-bottom-20 - = f.email_field :email, placeholder: "Email", class: "form-control", required: true + = f.email_field :email, placeholder: "Email", class: "form-control", required: true, value: params[:user_email] .clearfix = f.submit "Reset password", class: "btn-primary btn" diff --git a/app/views/notify/new_user_email.html.haml b/app/views/notify/new_user_email.html.haml index 39cb01d4d29..4feacdaacff 100644 --- a/app/views/notify/new_user_email.html.haml +++ b/app/views/notify/new_user_email.html.haml @@ -11,6 +11,6 @@ - if @user.created_by_id %p - = link_to "Click here to set your password", edit_password_url(@user, :reset_password_token => @token) + = link_to "Click here to set your password", edit_password_url(@user, reset_password_token: @token) %p = reset_token_expire_message |