Skip to content

Commit

Permalink
When using User#send_reset_password_instructions, redirect_url should…
Browse files Browse the repository at this point in the history
… be set to default url if not present in opts
  • Loading branch information
mengqing committed Jan 24, 2019
1 parent 1254483 commit 552a753
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/models/devise_token_auth/concerns/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def send_reset_password_instructions(opts = {})

# fall back to "default" config name
opts[:client_config] ||= 'default'
opts[:redirect_url] ||= DeviseTokenAuth.default_password_reset_url

send_devise_notification(:reset_password_instructions, token, opts)
token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,7 @@ class DeviseTokenAuth::PasswordsControllerTest < ActionController::TestCase
DeviseTokenAuth.default_password_reset_url = @redirect_url

post :create,
params: { email: @resource.email,
redirect_url: @redirect_url }
params: { email: @resource.email }

@mail = ActionMailer::Base.deliveries.last
@resource.reload
Expand Down

0 comments on commit 552a753

Please sign in to comment.