mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-14 13:51:01 +02:00
Fix: Improve OIDC username fallback, email parsing, and code clarity ;)
This commit is contained in:
parent
c4062c425d
commit
daccf722f9
@ -333,7 +333,7 @@ func (u *User) FromClaim(claims *OIDCClaims) {
|
||||
if parseErr == nil {
|
||||
// If email is parsable, extract the local part (before '@').
|
||||
parts := strings.Split(claims.Email, "@")
|
||||
if len(parts) > 0 && parts[0] != "" {
|
||||
if parts[0] != "" {
|
||||
emailPrefix := parts[0]
|
||||
valErr := util.ValidateUsername(emailPrefix)
|
||||
if valErr == nil {
|
||||
|
Loading…
Reference in New Issue
Block a user