Sha256: faa5ae8bb4c23c4676e5007cd663d5dd3655ee2f8621e0b9ce78186c0b99ba3a

Contents?: true

Size: 625 Bytes

Versions: 3

Compression:

Stored size: 625 Bytes

Contents

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
  def mercadolibre
    # You need to implement the method below in your model (e.g. app/models/user.rb)
    @user = User.find_for_mercadolibre_oauth(request.env["omniauth.auth"])

    if @user.persisted?
      sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
      set_flash_message(:notice, :success, :kind => "MercadoLibre") if is_navigational_format?
    else
      session["devise.mercadolibre_data"] = request.env["omniauth.auth"]
      redirect_to new_user_registration_url
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
omniauth-mercadolibre-0.0.4 test/dump/app/controllers/users/omniauth_callbacks_controller.rb
omniauth-mercadolibre-0.0.3 test/dump/app/controllers/users/omniauth_callbacks_controller.rb
omniauth-mercadolibre-0.0.1 test/dump/app/controllers/users/omniauth_callbacks_controller.rb