Sha256: 14ffe3d8af0eb47af46b3aee41ef373c5fba9598c88c35a869fec77e6f13ba56

Contents?: true

Size: 537 Bytes

Versions: 10

Compression:

Stored size: 537 Bytes

Contents

module Oauth
  class AuthorizationController < ApplicationController
    def authorize
      url = Services::Authorization::GetAuthorizationUri.new(request: request).call
      redirect_to url
    end

    def callback
      tokens = Services::Authorization::Tokens::Generate.new(
        code: params[:code],
        request: request
      ).call
      Token.instance.update!(tokens)
      session['tokens'] = tokens
      Services::Authorization::AuthorizeHubspot.new(tokens: tokens).call
      redirect_to '/events'
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hubspot-api-client-3.2.0 sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb
hubspot-api-client-3.1.1 sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb
hubspot-api-client-3.1.0.pre.beta sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb
hubspot-api-client-3.0.0.pre.beta sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb
hubspot-api-client-2.3.2 sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb
hubspot-api-client-2.3.1 sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb
hubspot-api-client-2.2.0 sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb
hubspot-api-client-2.1.0 sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb
hubspot-api-client-2.0.0 sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb
hubspot-api-client-1.0.1 sample-apps/webhooks-contacts-app/app/controllers/oauth/authorization_controller.rb