|
|
@ -101,7 +101,7 @@ module Devise |
|
|
|
def create_direct_otp(options = {}) |
|
|
|
def create_direct_otp(options = {}) |
|
|
|
# Create a new random OTP and store it in the database |
|
|
|
# Create a new random OTP and store it in the database |
|
|
|
digits = options[:length] || self.class.direct_otp_length || 6 |
|
|
|
digits = options[:length] || self.class.direct_otp_length || 6 |
|
|
|
update_attributes( |
|
|
|
update( |
|
|
|
direct_otp: random_base10(digits), |
|
|
|
direct_otp: random_base10(digits), |
|
|
|
direct_otp_sent_at: Time.now.utc |
|
|
|
direct_otp_sent_at: Time.now.utc |
|
|
|
) |
|
|
|
) |
|
|
@ -122,7 +122,7 @@ module Devise |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def clear_direct_otp |
|
|
|
def clear_direct_otp |
|
|
|
update_attributes(direct_otp: nil, direct_otp_sent_at: nil) |
|
|
|
update(direct_otp: nil, direct_otp_sent_at: nil) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|