Sha256: 26957e25e4029ebce54e49ef365cbeaf7c545453e4c1d8a7c4e61aed41d358af

Contents?: true

Size: 645 Bytes

Versions: 19

Compression:

Stored size: 645 Bytes

Contents

# typed: true
# frozen_string_literal: true

module Workato
  module Web
    class App
      CODE_PATH = '/code'
      CALLBACK_PATH = '/oauth/callback'

      def call(env)
        req = Rack::Request.new(env)
        case req.path_info
        when /#{CODE_PATH}/
          [200, { 'Content-Type' => 'text/plain' }, [@code.to_s]]
        when /#{CALLBACK_PATH}/
          @code = req.params['code']
          [200, { 'Content-Type' => 'text/plain' }, ['We stored response code. Now you can close the browser window']]
        else
          [404, { 'Content-Type' => 'text/plain' }, ['404: Not Found']]
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
workato-connector-sdk-1.3.14 lib/workato/web/app.rb
workato-connector-sdk-1.3.13 lib/workato/web/app.rb
workato-connector-sdk-1.3.12 lib/workato/web/app.rb
workato-connector-sdk-1.3.11 lib/workato/web/app.rb
workato-connector-sdk-1.3.10 lib/workato/web/app.rb
workato-connector-sdk-1.3.9 lib/workato/web/app.rb
workato-connector-sdk-1.3.8 lib/workato/web/app.rb
workato-connector-sdk-1.3.7 lib/workato/web/app.rb
workato-connector-sdk-1.3.6 lib/workato/web/app.rb
workato-connector-sdk-1.3.5 lib/workato/web/app.rb
workato-connector-sdk-1.3.4 lib/workato/web/app.rb
workato-connector-sdk-1.3.3 lib/workato/web/app.rb
workato-connector-sdk-1.3.2 lib/workato/web/app.rb
workato-connector-sdk-1.3.1 lib/workato/web/app.rb
workato-connector-sdk-1.3.0 lib/workato/web/app.rb
workato-connector-sdk-1.2.0 lib/workato/web/app.rb
workato-connector-sdk-1.0.3 lib/workato/web/app.rb
workato-connector-sdk-1.1.0 lib/workato/web/app.rb
workato-connector-sdk-1.0.2 lib/workato/web/app.rb