Class: Spree::Api::V2::Storefront::UserRegistrationWithPinCodesController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Spree::Api::V2::Storefront::UserRegistrationWithPinCodesController
- Defined in:
- app/controllers/spree/api/v2/storefront/user_registration_with_pin_codes_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/spree/api/v2/storefront/user_registration_with_pin_codes_controller.rb', line 12 def create = user_with_pin_code_params context = SpreeCmCommissioner::UserPinCodeAuthenticator.call() if context.success? token_context = SpreeCmCommissioner::OauthTokenGenerator.call( application: doorkeeper_token.application, resource_owner: context.user ) render json: token_context.token_response else render_error_payload(context.) end end |
#validate_token_client! ⇒ Object
8 9 10 |
# File 'app/controllers/spree/api/v2/storefront/user_registration_with_pin_codes_controller.rb', line 8 def validate_token_client! raise Doorkeeper::Errors::DoorkeeperError if doorkeeper_token&.application.nil? end |