Update hscontrol/types/users.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Kristoffer Dalby 2024-08-21 08:16:23 +02:00 committed by Kristoffer Dalby
parent 25a206d1c5
commit e78aaa85ac
No known key found for this signature in database

View file

@ -50,7 +50,7 @@ type User struct {
// should be used throughout headscale, in information returned to the
// user and the Policy engine.
func (u *User) Username() string {
return cmp.Or(u.Email, u.Name, u.ProviderIdentifier, fmt.Sprintf("%d", u.ID))
return cmp.Or(u.Email, u.Name, u.ProviderIdentifier, strconv.FormatUint(uint64(u.ID), 10))
}
// DisplayNameOrUsername returns the DisplayName if it exists, otherwise