Merge pull request #5763 from tchak/2falocalanddev

Adapt 2FA issuer for local and staging environements
This commit is contained in:
LeSim 2020-12-08 14:08:06 +01:00 committed by GitHub
commit 0012fd3aa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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