Skip to content

Commit 5707ad3

Browse files
daviianlunny
authored andcommitted
Add AppURL without trailing slash to TOTP issuer parameter to prevent conflicting accounts on multiple gitea installations (#2335)
Signed-off-by: David Schneiderbauer <[email protected]>
1 parent 4c13a84 commit 5707ad3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/user/setting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ func twofaGenerateSecretAndQr(ctx *context.Context) bool {
583583
if otpKey == nil {
584584
err = nil // clear the error, in case the URL was invalid
585585
otpKey, err = totp.Generate(totp.GenerateOpts{
586-
Issuer: setting.AppName,
586+
Issuer: setting.AppName + " (" + strings.TrimRight(setting.AppURL, "/") + ")",
587587
AccountName: ctx.User.Name,
588588
})
589589
if err != nil {

0 commit comments

Comments
 (0)