Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 for invalid link with password reset token #411

Merged
merged 1 commit into from Oct 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions app/controllers/devise_token_auth/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def edit
config: params[:config]
}))
else
render_edit_error
raise ActionController::RoutingError.new('Not Found')
end
end

Expand Down Expand Up @@ -174,12 +174,6 @@ def render_create_error
}, status: @error_status
end

def render_edit_error
render json: {
success: false
}, status: 404
end

def render_update_error_unauthorized
render json: {
success: false,
Expand Down
10 changes: 5 additions & 5 deletions test/controllers/devise_token_auth/passwords_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ class DeviseTokenAuth::PasswordsControllerTest < ActionController::TestCase
end

describe 'password reset link failure' do
test 'respone should return 404' do
xhr :get, :edit, {
reset_password_token: 'bogus',
test 'response should return 404' do
assert_raises(ActionController::RoutingError) {
xhr :get, :edit, {
reset_password_token: "bogus",
redirect_url: @mail_redirect_url
}
}

assert_equal 404, response.status
end
end

Expand Down