From bb79a2bc1c4165d4cd43fbc97f4ca22833d7470f Mon Sep 17 00:00:00 2001 From: Tyler Rockwell Date: Tue, 20 Feb 2018 12:27:43 -0500 Subject: [PATCH] Shorten sessions#create method --- app/controllers/devise_token_auth/sessions_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/devise_token_auth/sessions_controller.rb b/app/controllers/devise_token_auth/sessions_controller.rb index 6b72f80e6..559d456c5 100644 --- a/app/controllers/devise_token_auth/sessions_controller.rb +++ b/app/controllers/devise_token_auth/sessions_controller.rb @@ -22,8 +22,7 @@ def create if @resource && valid_params?(field, q_value) && (!@resource.respond_to?(:active_for_authentication?) || @resource.active_for_authentication?) valid_password = @resource.valid_password?(resource_params[:password]) if (@resource.respond_to?(:valid_for_authentication?) && !@resource.valid_for_authentication? { valid_password }) || !valid_password - render_create_error_bad_credentials - return + return render_create_error_bad_credentials end @client_id, @token = @resource.create_token @resource.save