mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-01 10:00:19 +08:00
feat: fix Apple OAuth issue (#2338)
* feat: fix sign in with apple bug * fix username
This commit is contained in:
@ -300,3 +300,12 @@ func GetValueFromDataSourceName(key string, dataSourceName string) string {
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func GetUsernameFromEmail(email string) string {
|
||||
tokens := strings.Split(email, "@")
|
||||
if len(tokens) == 0 {
|
||||
return uuid.NewString()
|
||||
} else {
|
||||
return tokens[0]
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user