Skip to content

Commit

Permalink
Log if OIDC username is not consider valid
Browse files Browse the repository at this point in the history
Updates juanfont#2333

Signed-off-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
kradalby committed Jan 10, 2025
1 parent ede4f97 commit 973bbbb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hscontrol/types/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
"github.com/juanfont/headscale/hscontrol/util"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/timestamppb"
"gorm.io/gorm"
"tailscale.com/tailcfg"
Expand Down Expand Up @@ -176,6 +177,8 @@ func (u *User) FromClaim(claims *OIDCClaims) {
err := util.CheckForFQDNRules(claims.Username)
if err == nil {
u.Name = claims.Username
} else {
log.Debug().Err(err).Msgf("Username %s is not valid", claims.Username)
}

if claims.EmailVerified {
Expand Down

0 comments on commit 973bbbb

Please sign in to comment.