mirror of
https://github.com/heartcombo/devise.git
synced 2026-02-07 13:05:01 -05:00
Move duplicate sign_in logic to sign_in().
This commit is contained in:
@@ -110,6 +110,8 @@ module Devise
|
||||
|
||||
if options[:bypass]
|
||||
warden.session_serializer.store(resource, scope)
|
||||
elsif warden.user(scope) == resource && !options.delete(:force)
|
||||
# Do nothing. User already signed in and we are not forcing it.
|
||||
else
|
||||
warden.set_user(resource, options.merge!(:scope => scope))
|
||||
end
|
||||
@@ -199,13 +201,7 @@ module Devise
|
||||
options = args.extract_options!
|
||||
scope = Devise::Mapping.find_scope!(resource_or_scope)
|
||||
resource = args.last || resource_or_scope
|
||||
|
||||
if warden.user(scope) == resource
|
||||
expire_session_data_after_sign_in!
|
||||
else
|
||||
sign_in(scope, resource, options)
|
||||
end
|
||||
|
||||
sign_in(scope, resource, options)
|
||||
redirect_for_sign_in(scope, resource)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user