1
0
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:
Sirius 2025-05-28 19:33:11 +09:00
parent c4062c425d
commit daccf722f9
No known key found for this signature in database

View File

@ -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 {