summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorDavid Schneiderbauer <daviian@users.noreply.github.com>2017-08-19 03:39:43 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-08-19 09:39:43 +0800
commit5707ad3bb72179e90adea16174102303564a22a9 (patch)
tree5051e965d7b47af45131af4a51f0aeccec9df5c8 /routers/user
parent4c13a8458bd489e700577ddea2e6113af3477d99 (diff)
downloadgitea-5707ad3bb72179e90adea16174102303564a22a9.tar.gz
gitea-5707ad3bb72179e90adea16174102303564a22a9.zip
Add AppURL without trailing slash to TOTP issuer parameter to prevent conflicting accounts on multiple gitea installations (#2335)
Signed-off-by: David Schneiderbauer <dschneiderbauer@gmail.com>
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/setting.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go
index 93376043e0..b94f7dfb73 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 {