1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-04 18:19:54 +00:00

Fix a Telegram-related bug

I removed my favorite comment:

// Problems is something we put blankets on.
This commit is contained in:
Timur Ismagilov 2023-02-25 23:38:38 +03:00
parent 7b0aec0a2e
commit 3c32e40e59
2 changed files with 3 additions and 2 deletions

View File

@ -170,8 +170,9 @@ func handlerTelegramLogin(w http.ResponseWriter, rq *http.Request) {
false,
)
)
// If registering a user via Telegram failed, because a Telegram user with this name
// has already registered, then everything is actually ok!
if user.HasUsername(username) && user.ByName(username).Source == "telegram" {
// Problems is something we put blankets on.
err = nil
}

View File

@ -59,7 +59,7 @@ func Register(username, password, group, source string, force bool) error {
return fmt.Errorf("username %s is already taken", username)
case !force && cfg.RegistrationLimit > 0 && Count() >= cfg.RegistrationLimit:
return fmt.Errorf("reached the limit of registered users (%d)", cfg.RegistrationLimit)
case password == "":
case password == "" && source != "telegram":
return fmt.Errorf("password must not be empty")
}