Sha256: b2c8eb20bf3e5d267dc67e2921b9a708c12ce2004a39ed9cc0ab6346896723b2

Contents?: true

Size: 1.05 KB

Versions: 12

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true
class OauthController < ApplicationController
  # TODO
  # Routes for this controller are not provided by the gem and
  # should be set according to your needs

  def request_omniauth
    return redirect_to root_url unless is_admin

    # TODO
    # Perform oauth request here. The oauth process should be able to
    # remember the organization, either by a param in the request or using
    # a session
  end

  def create_omniauth
    org_uid = '' # TODO
    organization = Maestrano::Connector::Rails::Organization.find_by_uid_and_tenant(org_uid, current_user.tenant)

    return redirect_to root_url unless organization && is_admin?(current_user, organization)

    # TODO
    # Update organization with oauth params
    # Should at least set oauth_uid, oauth_token and oauth_provider
  end

  def destroy_omniauth
    organization = Maestrano::Connector::Rails::Organization.find_by_id(params[:organization_id])
    organization.clear_omniauth if organization && is_admin?(current_user, organization)

    redirect_to root_url
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.0.0.pre.RC9 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-2.0.0.pre.RC8 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-1.5.0 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-2.0.0.pre.RC7 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-2.0.0.pre.RC6 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-2.0.0.pre.RC5 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-2.0.0.pre.RC4 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-2.0.0.pre.RC3 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-2.0.0.pre.RC2 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-2.0.0.pre.RC1 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-1.4.0 lib/generators/connector/templates/oauth_controller.rb
maestrano-connector-rails-1.3.5 lib/generators/connector/templates/oauth_controller.rb