File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
lib/two_factor_authentication Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,13 @@ def handle_failed_second_factor(scope)
3535
3636 def two_factor_authentication_path_for ( resource_or_scope = nil )
3737 scope = Devise ::Mapping . find_scope! ( resource_or_scope )
38+ namespace = if Devise . available_router_name
39+ send ( Devise . available_router_name )
40+ else
41+ self
42+ end
3843 change_path = "#{ scope } _two_factor_authentication_path"
39- send ( change_path )
44+ namespace . send ( change_path )
4045 end
4146
4247 end
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def generate_totp_secret
101101 def create_direct_otp ( options = { } )
102102 # Create a new random OTP and store it in the database
103103 digits = options [ :length ] || self . class . direct_otp_length || 6
104- update_attributes (
104+ update_columns (
105105 direct_otp : random_base10 ( digits ) ,
106106 direct_otp_sent_at : Time . now . utc
107107 )
@@ -122,7 +122,7 @@ def direct_otp_expired?
122122 end
123123
124124 def clear_direct_otp
125- update_attributes ( direct_otp : nil , direct_otp_sent_at : nil )
125+ update_columns ( direct_otp : nil , direct_otp_sent_at : nil )
126126 end
127127 end
128128
You can’t perform that action at this time.
0 commit comments