feat: support WebAuthn login without username and upgrade Go to 1.21 (#3695)

This commit is contained in:
DacongDA
2025-04-01 16:35:59 +08:00
committed by GitHub
parent 2cc5e82d91
commit b6f943e326
6 changed files with 65 additions and 107 deletions

View File

@ -459,6 +459,20 @@ func GetUserByEmail(owner string, email string) (*User, error) {
}
}
func GetUserByWebauthID(webauthId string) (*User, error) {
user := User{}
existed, err := ormer.Engine.Where("webauthnCredentials LIKE ?", "%"+webauthId+"%").Get(&user)
if err != nil {
return nil, err
}
if !existed {
return nil, fmt.Errorf("user not exist")
}
return &user, err
}
func GetUserByEmailOnly(email string) (*User, error) {
if email == "" {
return nil, nil