Class: Spree::Api::V1::UsersController
- Inherits:
-
BaseController
- Object
- BaseController
- Spree::Api::V1::UsersController
- Defined in:
- app/controllers/spree/api/v1/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#sign_in ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/spree/api/v1/users_controller.rb', line 16 def sign_in @user = Spree::User.find_by_email(params[:user][:email]) if !@user.present? || !@user.valid_password?(params[:user][:password]) return end @user.generate_spree_api_key! if @user.spree_api_key.blank? end |
#sign_up ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'app/controllers/spree/api/v1/users_controller.rb', line 7 def sign_up @user = Spree::User.new(params[:user]) if !@user.save return end @user.generate_spree_api_key! end |