From 82e5aff7b344ac2c5f4543a3887db3e6bfcd0008 Mon Sep 17 00:00:00 2001 From: Dmitrii Golub Date: Thu, 4 Jul 2019 18:38:21 +0300 Subject: [PATCH] Additional comments in generate_totp_secret method --- .../models/two_factor_authenticatable.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/two_factor_authentication/models/two_factor_authenticatable.rb b/lib/two_factor_authentication/models/two_factor_authenticatable.rb index f5b94e9..6d73a0f 100644 --- a/lib/two_factor_authentication/models/two_factor_authenticatable.rb +++ b/lib/two_factor_authentication/models/two_factor_authenticatable.rb @@ -92,6 +92,9 @@ module Devise end def generate_totp_secret + # ROTP gem since version 5 to version 5.1 + # at version 5.1 ROTP gem reinstates. + # Details: https://github.com/mdp/rotp/blob/master/CHANGELOG.md#510 ROTP::Base32.try(:random) || ROTP::Base32.random_base32 end