Only create the opt_secret once. If created leave alone.
This commit is contained in:
parent
b72f88f60f
commit
0edc7d0563
@ -2,8 +2,10 @@ class MfasController < ApplicationController
|
||||
def new
|
||||
issuer = "Hidden Agenda Email"
|
||||
label = "#{issuer}:#{current_user.email}"
|
||||
if current_user.otp_secret.to_s.length == 0
|
||||
current_user.otp_secret = User.generate_otp_secret
|
||||
current_user.save!
|
||||
end
|
||||
|
||||
qrcode = RQRCode::QRCode.new([{ data: current_user.otp_provisioning_uri(label, issuer: issuer), mode: :byte_8bit }])
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user