mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 23:09:32 +02:00
Fix issue with log in with GitHub but need more error handle after
This commit is contained in:
1 parent
05fb34eacd
commit
9ea9818d32
13 files changed
+167
-60
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user