Sha256: 8c5882ca9a4111ffe0e657148da88e28b64a54121a7e70345a53c341638f456c

Contents?: true

Size: 435 Bytes

Versions: 6

Compression:

Stored size: 435 Bytes

Contents

module RestPack::Core::Service::Commands::Application
  class VerifyApiToken < RestPack::Service::Command
    required do
      integer :id
      string :api_token
    end

    def execute
      application = Core::Models::Application.find_by_id_and_api_token(
        inputs[:id],
        inputs[:api_token]
      )

      if application
        { id: application.id }
      else
        status :forbidden
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
restpack_core_service-0.0.11 lib/restpack_core_service/services/application/verify_api_token.rb
restpack_core_service-0.0.10 lib/restpack_core_service/services/application/verify_api_token.rb
restpack_core_service-0.0.9 lib/restpack_core_service/services/application/verify_api_token.rb
restpack_core_service-0.0.8 lib/restpack_core_service/services/application/verify_api_token.rb
restpack_core_service-0.0.7 lib/restpack_core_service/services/application/verify_api_token.rb
restpack_core_service-0.0.6 lib/restpack_core_service/services/application/verify_api_token.rb