Method: Devise::Controllers::SignInOut#bypass_sign_in

Defined in:
lib/devise/controllers/sign_in_out.rb

#bypass_sign_in(resource, scope: nil) ⇒ Object

Sign in a user bypassing the warden callbacks and stores the user straight in session. This option is useful in cases the user is already signed in, but we want to refresh the credentials in session.

Examples:

 @user, scope: :user
 @user


65
66
67
68
69
# File 'lib/devise/controllers/sign_in_out.rb', line 65

def (resource, scope: nil)
  scope ||= Devise::Mapping.find_scope!(resource)
  expire_data_after_sign_in!
  warden.session_serializer.store(resource, scope)
end