Class: InfinumAzure::Resources::OmniauthCallbacksController

Inherits:
Devise::OmniauthCallbacksController
  • Object
show all
Defined in:
app/controllers/infinum_azure/resources/omniauth_callbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#failureObject



18
19
20
21
22
# File 'app/controllers/infinum_azure/resources/omniauth_callbacks_controller.rb', line 18

def failure
  set_flash_message! :alert, :failure, kind: OmniAuth::Utils.camelize(failed_strategy.name),
                                       reason: failure_message
  redirect_to root_path
end

#infinum_azureObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/infinum_azure/resources/omniauth_callbacks_controller.rb', line 6

def infinum_azure
  resource = InfinumAzure::Resources::Finder.from_omniauth(omniauth)

  if resource
    flash[:notice] = I18n.t 'devise.omniauth_callbacks.success', kind: 'Azure'
     resource, event: :authentication
  else
    flash[:notice] = 'You do not have permission to access this application.' # rubocop:disable Rails/I18nLocaleTexts
    redirect_to root_path
  end
end