sign_in: extract the procedure context to a ProcedureContextConcern
This commit is contained in:
parent
e580d336e4
commit
4fd9fa6610
7 changed files with 147 additions and 54 deletions
|
@ -1,6 +1,15 @@
|
|||
module Devise
|
||||
# Useful helpers additions to Devise::Controllers::StoreLocation
|
||||
module StoreLocationExtension
|
||||
# A variant of `stored_location_key_for` which doesn't delete the stored path.
|
||||
def get_stored_location_for(resource_or_scope)
|
||||
location = stored_location_for(resource_or_scope)
|
||||
if location
|
||||
store_location_for(resource_or_scope, location)
|
||||
end
|
||||
location
|
||||
end
|
||||
|
||||
# Delete the url stored in the session for the given scope.
|
||||
def clear_stored_location_for(resource_or_scope)
|
||||
session_key = send(:stored_location_key_for, resource_or_scope)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue