Sha256: e1c031383b81f80d7917cd3faa4bdbc07ae57833cddb94b837ae10b9d337932e

Contents?: true

Size: 472 Bytes

Versions: 22

Compression:

Stored size: 472 Bytes

Contents

class ApplicationController < ActionController::Base
  include ExceptionHandler

  before_action :check_env_variables

  helper_method :authorized?

  private

  def authorized?
    session['tokens'].present?
  end

  def check_env_variables
    missing_vars = %w[HUBSPOT_CLIENT_ID HUBSPOT_CLIENT_SECRET].select { |var| ENV[var].blank? }
    raise(ExceptionHandler::HubspotError.new, "Please specify #{missing_vars.join(', ')} in .env") if missing_vars.present?
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
hubspot-api-client-9.0.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-8.0.1 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-8.0.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-7.3.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-7.2.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-7.1.1 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-7.1.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-7.0.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-6.0.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-5.0.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-4.0.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-3.3.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-3.2.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-3.1.1 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-3.1.0.pre.beta sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-3.0.0.pre.beta sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-2.3.2 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-2.3.1 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-2.2.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb
hubspot-api-client-2.1.0 sample-apps/webhooks-contacts-app/app/controllers/application_controller.rb