Module: Faalis::Omniauth::Callbacks

Included in:
CallbacksController
Defined in:
lib/faalis/omniauth/callbacks.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) create_or_find_user (private)



51
52
53
54
# File 'lib/faalis/omniauth/callbacks.rb', line 51

def create_or_find_user
  # This method is implemented in User model
  @user = User.find_from_oauth(request.env["omniauth.auth"], current_user)
end

- (Object) default_service_callback



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/faalis/omniauth/callbacks.rb', line 26

def default_service_callback

  create_or_find_user

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