diff options
author | David Schneiderbauer <daviian@users.noreply.github.com> | 2017-08-19 03:39:43 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-08-19 09:39:43 +0800 |
commit | 5707ad3bb72179e90adea16174102303564a22a9 (patch) | |
tree | 5051e965d7b47af45131af4a51f0aeccec9df5c8 /routers/user | |
parent | 4c13a8458bd489e700577ddea2e6113af3477d99 (diff) | |
download | gitea-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.go | 2 |
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 { |