Skip to content

Commit

Permalink
Shorten sessions#create method
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerRockwell committed Feb 20, 2018
1 parent 87a1d6e commit bb79a2b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/controllers/devise_token_auth/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb79a2b

Please sign in to comment.