Skip to content

Commit aad5744

Browse files
committed
Expose user login type via api
1 parent 1e6bd37 commit aad5744

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

codersdk/users.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type User struct {
4545
OrganizationIDs []uuid.UUID `json:"organization_ids" format:"uuid"`
4646
Roles []Role `json:"roles"`
4747
AvatarURL string `json:"avatar_url" format:"uri"`
48+
LoginType LoginType `json:"login_type"`
4849
}
4950

5051
type GetUsersResponse struct {

enterprise/coderd/groups.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ func convertUser(user database.User, organizationIDs []uuid.UUID) codersdk.User
416416
OrganizationIDs: organizationIDs,
417417
Roles: make([]codersdk.Role, 0, len(user.RBACRoles)),
418418
AvatarURL: user.AvatarURL.String,
419+
LoginType: codersdk.LoginType(user.LoginType),
419420
}
420421

421422
for _, roleName := range user.RBACRoles {

enterprise/coderd/userauth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestUserOIDC(t *testing.T) {
2828
t.Run("Roles", func(t *testing.T) {
2929
t.Parallel()
3030

31-
t.Run("NewUser", func(t *testing.T) {
31+
t.Run("NewUserAndRemoveRoles", func(t *testing.T) {
3232
t.Parallel()
3333

3434
ctx := testutil.Context(t, testutil.WaitMedium)

0 commit comments

Comments
 (0)