Add GoogleIdProvider.

This commit is contained in:
Yang Luo
2021-02-21 23:51:40 +08:00
parent e91fdca5e7
commit dfa77ab25d
7 changed files with 163 additions and 64 deletions

View File

@ -28,16 +28,8 @@ func (user *User) getId() string {
return fmt.Sprintf("%s/%s", user.Owner, user.Name)
}
func HasMail(application *Application, email string) string {
user := GetMail(application.Organization, email)
if user != nil {
return user.getId()
}
return ""
}
func HasGithub(application *Application, github string) string {
user := GetGithub(application.Organization, github)
func GetUserIdByField(application *Application, field string, value string) string {
user := GetUserByField(application.Organization, field, value)
if user != nil {
return user.getId()
}