From 5707ad3bb72179e90adea16174102303564a22a9 Mon Sep 17 00:00:00 2001 From: David Schneiderbauer Date: Sat, 19 Aug 2017 03:39:43 +0200 Subject: [PATCH] Add AppURL without trailing slash to TOTP issuer parameter to prevent conflicting accounts on multiple gitea installations (#2335) Signed-off-by: David Schneiderbauer --- routers/user/setting.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/user/setting.go b/routers/user/setting.go index 93376043e..b94f7dfb7 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -583,7 +583,7 @@ func twofaGenerateSecretAndQr(ctx *context.Context) bool { if otpKey == nil { err = nil // clear the error, in case the URL was invalid otpKey, err = totp.Generate(totp.GenerateOpts{ - Issuer: setting.AppName, + Issuer: setting.AppName + " (" + strings.TrimRight(setting.AppURL, "/") + ")", AccountName: ctx.User.Name, }) if err != nil {