Sha256: 9149e6e0716615a69655bd6c90eb7a198febd2f5a5124dd21d255994a648af70

Contents?: true

Size: 723 Bytes

Versions: 18

Compression:

Stored size: 723 Bytes

Contents

# frozen_string_literal: true

module G5Authenticatable
  # Custom sessions controller to handle auth server interaction
  class SessionsController < DeviseG5Authenticatable::SessionsController
    protected

    def register_resource
      create_resource
      sign_in_resource
    end

    def signed_in_root_path(_resource_or_scope)
      main_app.root_path
    end

    def create_resource
      self.resource = G5Authenticatable::User.new_with_session({}, session)
      resource.update_g5_credentials(auth_data)
      resource.save!
    end

    def after_omniauth_failure_path_for(_scope)
      auth_error_path
    end

    def after_sign_out_path_for(_resource_or_scope)
      main_app.root_path
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
g5_authenticatable-1.1.4 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.4.rc.3 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.4.rc.2 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.4.rc.1 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.2 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.2.pre.1 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.2.rc.5 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.2.rc.4 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.2.rc.3 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.2.rc.2 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.2.rc.1 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.1 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.1.0 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.0.0 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.0.0.pre.4 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.0.0.pre.3 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.0.0.pre.2 app/controllers/g5_authenticatable/sessions_controller.rb
g5_authenticatable-1.0.0.pre.1 app/controllers/g5_authenticatable/sessions_controller.rb