1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix issue with log in with GitHub but need more error handle after

This commit is contained in:
Unknown
2014-04-07 12:56:40 -04:00
parent 05fb34eacd
commit 9ea9818d32
13 changed files with 167 additions and 60 deletions

View File

@@ -366,6 +366,19 @@ func GetUserByName(name string) (*User, error) {
return user, nil
}
// GetUserEmailsByNames returns a slice of e-mails corresponds to names.
func GetUserEmailsByNames(names []string) []string {
mails := make([]string, 0, len(names))
for _, name := range names {
u, err := GetUserByName(name)
if err != nil {
continue
}
mails = append(mails, u.Email)
}
return mails
}
// GetUserByEmail returns the user object by given e-mail if exists.
func GetUserByEmail(email string) (*User, error) {
if len(email) == 0 {