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