Sha256: ff301f5a09fef47cb50e82b32fa2f093d76128be4013f462000cfe0f635371ac

Contents?: true

Size: 688 Bytes

Versions: 26

Compression:

Stored size: 688 Bytes

Contents

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
  before_action :enter_with_oauth

  def vkontakte
  end

  def facebook
  end

  def odnoklassniki
  end

  def enter_with_oauth
    @user= User.from_omniauth(oauth_params)
    if @user.persisted?
      sign_in_and_redirect @user, event: :authentication
      set_flash_message(:notice, :success, kind: action_name) if is_navigational_format?
    else
      session["devise.oauth_data"] = request.env["omniauth.auth"]
      redirect_to new_user_registration_url
    end
  end

  private
    def oauth_params
      ActionController::Parameters.new(auth_hash: request.env["omniauth.auth"]).permit!
    end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
teleporter-2.0.11 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-2.0.10 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-2.0.9 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-2.0.8 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-2.0.7 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-2.0.6 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-2.0.4 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-2.0.2 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-2.0.1 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-2.0.0 lib/generators/teleport/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-1.2.4 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-1.2.3 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-1.2.2 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-1.2.1 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-1.1.1 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-1.1.0 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-1.0.2 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-1.0.1 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-1.0.0 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb
teleporter-0.1.0 lib/generators/initial/templates/devise_oauth/omniauth_callbacks_controller.rb