You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
685 B
20 lines
685 B
13 years ago
|
module ActionDispatch::Routing
|
||
|
class Mapper
|
||
|
protected
|
||
|
|
||
|
def devise_two_factor_authentication(mapping, controllers)
|
||
10 years ago
|
resource :two_factor_authentication, :only => [:show, :update, :resend_code], :path => mapping.path_names[:two_factor_authentication], :controller => controllers[:two_factor_authentication] do
|
||
3 years ago
|
collection { get resend_code_path(mapping), as: "resend_code" }
|
||
10 years ago
|
end
|
||
13 years ago
|
end
|
||
3 years ago
|
|
||
|
def resend_code_path(mapping)
|
||
|
Devise.mappings[resource_name(mapping)].path_names[:two_factor_authentication_resend_code] || "resend_code"
|
||
|
end
|
||
|
|
||
|
def resource_name(mapping)
|
||
|
mapping.class_name.underscore.to_sym
|
||
|
end
|
||
13 years ago
|
end
|
||
|
end
|