Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Take into an account custom Devise.router_name #201

Open
wants to merge 1 commit into
base: master
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
8 changes: 6 additions & 2 deletions lib/devise_security_extension/controllers/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ def redirect_for_paranoid_verification(scope)
def change_password_required_path_for(resource_or_scope = nil)
scope = Devise::Mapping.find_scope!(resource_or_scope)
change_path = "#{scope}_password_expired_path"
send(change_path)
_devise_security_extention_route_context.send(change_path)
end

def paranoid_verification_code_path_for(resource_or_scope = nil)
scope = Devise::Mapping.find_scope!(resource_or_scope)
change_path = "#{scope}_paranoid_verification_code_path"
send(change_path)
_devise_security_extention_route_context.send(change_path)
end

def _devise_security_extention_route_context
@_devise_security_extention_route_context ||= send(Devise.available_router_name)
end

protected
Expand Down