Class: Spree::Api::V2::Tenant::UserRegistrationWithPinCodesController
- Inherits:
-
BaseController
- Object
- ResourceController
- BaseController
- Spree::Api::V2::Tenant::UserRegistrationWithPinCodesController
show all
- Defined in:
- app/controllers/spree/api/v2/tenant/user_registration_with_pin_codes_controller.rb
Instance Method Summary
collapse
#render_serialized_payload, #require_tenant, #scope
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/tenant/user_registration_with_pin_codes_controller.rb', line 12
def create
options = user_with_pin_code_params
context = SpreeCmCommissioner::UserPinCodeAuthenticator.call(options)
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.message)
end
end
|
#validate_token_client! ⇒ Object
8
9
10
|
# File 'app/controllers/spree/api/v2/tenant/user_registration_with_pin_codes_controller.rb', line 8
def validate_token_client!
raise Doorkeeper::Errors::DoorkeeperError if doorkeeper_token&.application.nil?
end
|