Sha256: be414d35bd3471939d852e81929289c844efc1ee454f9dea441ae12e63cf50c3

Contents?: true

Size: 563 Bytes

Versions: 15

Compression:

Stored size: 563 Bytes

Contents

module Spree
  module Api
    module V2
      module Storefront
        class AccountConfirmationsController < ::Spree::Api::V2::BaseController

          def show
            user = Spree.user_class.confirm_by_token(params[:id])

            if user.errors.empty?
              render json: { data: { state: user.respond_to?(:state) ? user.state : '' } }, status: :ok
            else
              render json: { error: user.errors.full_messages.to_sentence }, status: :unprocessable_entity
            end
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
spree_auth_devise-4.6.3 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.6.2 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.6.1 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.6.0 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.5.0 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.4.2 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.2.1 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.4.1 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.4.0 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.3.4 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.3.3 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.3.2 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.3.1 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.3.0 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb
spree_auth_devise-4.2.0 app/controllers/spree/api/v2/storefront/account_confirmations_controller.rb