Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign_in_and_redirect implementation follows it's documentation #5587

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/devise/controllers/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def signed_in_root_path(resource_or_scope)
# end
#
def after_sign_in_path_for(resource_or_scope)
stored_location_for(resource_or_scope) || signed_in_root_path(resource_or_scope)
signed_in_root_path(resource_or_scope)
end

# Method used by sessions controller to sign out a user. You can overwrite
Expand All @@ -237,7 +237,8 @@ def sign_in_and_redirect(resource_or_scope, *args)
scope = Devise::Mapping.find_scope!(resource_or_scope)
resource = args.last || resource_or_scope
sign_in(scope, resource, options)
redirect_to after_sign_in_path_for(resource)
location = stored_location_for(resource_or_scope) || after_sign_in_path_for(resource)
redirect_to location
end

# Sign out a user and tries to redirect to the url specified by
Expand Down