|
|
@ -81,7 +81,6 @@ func twofaGenerateSecretAndQr(ctx *context.Context) bool { |
|
|
|
// Filter unsafe character ':' in issuer
|
|
|
|
// Filter unsafe character ':' in issuer
|
|
|
|
issuer := strings.Replace(setting.AppName+" ("+setting.Domain+")", ":", "", -1) |
|
|
|
issuer := strings.Replace(setting.AppName+" ("+setting.Domain+")", ":", "", -1) |
|
|
|
if otpKey == nil { |
|
|
|
if otpKey == nil { |
|
|
|
err = nil // clear the error, in case the URL was invalid
|
|
|
|
|
|
|
|
otpKey, err = totp.Generate(totp.GenerateOpts{ |
|
|
|
otpKey, err = totp.Generate(totp.GenerateOpts{ |
|
|
|
SecretSize: 40, |
|
|
|
SecretSize: 40, |
|
|
|
Issuer: issuer, |
|
|
|
Issuer: issuer, |
|
|
|