Revert "Login requires a http/https login URL and revmoe SSH as a login method. SSH will be optional (#826)" (#891)

This reverts commit 90f8624ae7.

Fixes: #890

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/tea/pulls/891
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Michal Suchanek <msuchanek@suse.de>
Co-committed-by: Michal Suchanek <msuchanek@suse.de>
This commit is contained in:
Michal Suchanek
2026-02-08 00:21:47 +00:00
committed by Lunny Xiao
parent 3595f8f89d
commit e644cc49d4
4 changed files with 59 additions and 41 deletions

View File

@@ -68,6 +68,9 @@ func CreateLogin(name, token, user, passwd, otp, scopes, sshKey, giteaURL, sshCe
token,
user,
passwd,
sshAgent,
sshKey,
sshCertPrincipal,
)
if err != nil {
return err
@@ -92,7 +95,7 @@ func CreateLogin(name, token, user, passwd, otp, scopes, sshKey, giteaURL, sshCe
VersionCheck: versionCheck,
}
if len(token) == 0 {
if len(token) == 0 && sshCertPrincipal == "" && !sshAgent && sshKey == "" {
if login.Token, err = generateToken(login, user, passwd, otp, scopes); err != nil {
return err
}