sessions: add a helper to clear the stored return path

This commit is contained in:
Pierre de La Morinerie 2019-01-14 15:16:23 +00:00
parent e39fd7b171
commit e580d336e4
6 changed files with 65 additions and 8 deletions

View file

@ -0,0 +1,10 @@
module Devise
# Useful helpers additions to Devise::Controllers::StoreLocation
module StoreLocationExtension
# 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)
session.delete(session_key)
end
end
end