Adapt 2FA issuer for local and staging environements

This commit is contained in:
Paul Chavard 2020-11-25 18:16:32 +01:00 committed by LeSim (Rebase PR Action)
parent f1f52e392e
commit 43b6f198d5

View file

@ -22,7 +22,13 @@ class SuperAdminsController < ApplicationController
def generate_qr_code
issuer = 'DSManager'
issuer += "-dev" if Rails.env.development?
if Rails.env.development?
issuer += " (local)"
elsif staging?
issuer += " (dev)"
end
label = "#{issuer}:#{current_super_admin.email}"
RQRCode::QRCode.new(current_super_admin.otp_provisioning_uri(label, issuer: issuer))
end