mirror of
https://gitea.com/gitea/tea.git
synced 2026-02-21 22:03:32 +01:00
More improvements (#870)
- no duplicate logins - link to html page rather than api in output - client side pagination of watched repos Reviewed-on: https://gitea.com/gitea/tea/pulls/870 Co-authored-by: techknowlogick <techknowlogick@gitea.com> Co-committed-by: techknowlogick <techknowlogick@gitea.com>
This commit is contained in:
committed by
techknowlogick
parent
20da414145
commit
f638dba99b
@@ -170,6 +170,13 @@ func AddLogin(login *Login) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Check for duplicate login names
|
||||
for _, existing := range config.Logins {
|
||||
if strings.EqualFold(existing.Name, login.Name) {
|
||||
return fmt.Errorf("login name '%s' already exists", login.Name)
|
||||
}
|
||||
}
|
||||
|
||||
// save login to global var
|
||||
config.Logins = append(config.Logins, *login)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user