From 8f9377b28f0adf2650d3a4be0ae9878ef521fb60 Mon Sep 17 00:00:00 2001 From: Jasper van den Berg Date: Fri, 14 Jun 2019 15:48:27 +0200 Subject: [PATCH] Use ROTP::Base32.random instead of ROTP::Base32.random_base32 if available --- .../models/two_factor_authenticatable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/two_factor_authentication/models/two_factor_authenticatable.rb b/lib/two_factor_authentication/models/two_factor_authenticatable.rb index eb6398c..f5b94e9 100644 --- a/lib/two_factor_authentication/models/two_factor_authenticatable.rb +++ b/lib/two_factor_authentication/models/two_factor_authenticatable.rb @@ -92,7 +92,7 @@ module Devise end def generate_totp_secret - ROTP::Base32.random_base32 + ROTP::Base32.try(:random) || ROTP::Base32.random_base32 end def create_direct_otp(options = {})