Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5fdd491

Browse files
committed
login method telemetry
1 parent 2788eb5 commit 5fdd491

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

coderd/telemetry/telemetry.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,13 +940,15 @@ func ConvertUser(dbUser database.User) User {
940940
hash := sha256.Sum256([]byte(dbUser.Email[:atSymbol]))
941941
emailHashed = fmt.Sprintf("%x%s", hash[:], dbUser.Email[atSymbol:])
942942
}
943+
loginType := string(dbUser.LoginType)
943944
return User{
944945
ID: dbUser.ID,
945946
EmailHashed: emailHashed,
946947
RBACRoles: dbUser.RBACRoles,
947948
CreatedAt: dbUser.CreatedAt,
948949
Status: dbUser.Status,
949950
GithubComUserID: dbUser.GithubComUserID.Int64,
951+
LoginType: &loginType,
950952
}
951953
}
952954

@@ -1149,6 +1151,9 @@ type User struct {
11491151
RBACRoles []string `json:"rbac_roles"`
11501152
Status database.UserStatus `json:"status"`
11511153
GithubComUserID int64 `json:"github_com_user_id"`
1154+
// LoginType is nullable for backwards compatibility.
1155+
// We used to not set it at all.
1156+
LoginType *string `json:"login_type"`
11521157
}
11531158

11541159
type Group struct {

0 commit comments

Comments
 (0)