app/controllers/users/omniauth_callbacks_controller.rb
def all
    if AppSettings.get(:security, :disable_3rd_party_sign_in) ||
        AppSettings.get(:security, :force_sign_up_via_admin)

      raise ActionController::RoutingError.new('Not Found') # Triggers a 500
    end

    # Use the session locale set in {#passthru_localized}, or else the default.
    I18n.locale = session[:omniauth_locale] || I18n.default_locale

    omniauth = request.env['omniauth.auth']
    @user = User.from_omniauth(omniauth)

    if @user.persisted?
      sign_in_and_redirect @user

      if is_navigational_format?
        set_flash_message(:notice, :success, kind: omniauth.provider.titleize)
      end
    else
      # This data is used to pre-populate user fields in the registration form
      session['devise.omniauth'] = omniauth

      redirect_to new_user_registration_url
    end
  end
# Signs in the user, or redirects to the sign up page as required.
# This method should work for most providers. All you should have to do, is
# create aliases named to match the providers you wish to support.
Signs in the user, or redirects to the sign up page as required.
This method should work for most providers. All you should have to do, is
create aliases named to match the providers you wish to support.
Signs in the user or redirects to the sign up page as required . This method should work for most providers . All you should have to do is create aliases named to match the providers you wish to support .
def all
    if AppSettings.get(:security, :disable_3rd_party_sign_in) ||
        AppSettings.get(:security, :force_sign_up_via_admin)
      raise ActionController::RoutingError.new('Not Found') 
    end
    I18n.locale = session[:omniauth_locale] || I18n.default_locale
    omniauth = request.env['omniauth.auth']
    @user = User.from_omniauth(omniauth)
    if @user.persisted?
      sign_in_and_redirect @user
      if is_navigational_format?
        set_flash_message(:notice, :success, kind: omniauth.provider.titleize)
      end
    else
      session['devise.omniauth'] = omniauth
      redirect_to new_user_registration_url
    end
  end
def all if AppSettings . get ( :security , :disable_3rd_party_sign_in ) || AppSettings . get ( :security , :force_sign_up_via_admin ) raise ActionController :: RoutingError . new ( 'Not Found' ) end I18n . locale = session [ :omniauth_locale ] || I18n . default_locale omniauth = request . env [ 'omniauth.auth' ] @user = User . from_omniauth ( omniauth ) if @user . persisted? sign_in_and_redirect @user if is_navigational_format? set_flash_message ( :notice , :success , kind : omniauth . provider . titleize ) end else session [ 'devise.omniauth' ] = omniauth redirect_to new_user_registration_url end end
Signs in the user, or redirects to the sign up page as required.
Signs in the user or redirects to the sign up page as required .
# Triggers a 500 # Use the session locale set in {#passthru_localized}, or else the default. # This data is used to pre-populate user fields in the registration form