Skip to content

Commit d303330

Browse files
committed
remove disable login
1 parent ff8d4f4 commit d303330

File tree

4 files changed

+1
-24
lines changed

4 files changed

+1
-24
lines changed

cli/user_delete_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ func TestUserDelete(t *testing.T) {
3333
Password: pw,
3434
UserLoginType: codersdk.LoginTypePassword,
3535
OrganizationIDs: []uuid.UUID{owner.OrganizationID},
36-
DisableLogin: false,
3736
})
3837
require.NoError(t, err)
3938

@@ -64,7 +63,6 @@ func TestUserDelete(t *testing.T) {
6463
Password: pw,
6564
UserLoginType: codersdk.LoginTypePassword,
6665
OrganizationIDs: []uuid.UUID{owner.OrganizationID},
67-
DisableLogin: false,
6866
})
6967
require.NoError(t, err)
7068

@@ -95,7 +93,6 @@ func TestUserDelete(t *testing.T) {
9593
Password: pw,
9694
UserLoginType: codersdk.LoginTypePassword,
9795
OrganizationIDs: []uuid.UUID{owner.OrganizationID},
98-
DisableLogin: false,
9996
})
10097
require.NoError(t, err)
10198

@@ -128,7 +125,6 @@ func TestUserDelete(t *testing.T) {
128125
// Password: pw,
129126
// UserLoginType: codersdk.LoginTypePassword,
130127
// OrganizationID: aUser.OrganizationID,
131-
// DisableLogin: false,
132128
// })
133129
// require.NoError(t, err)
134130

coderd/coderdtest/coderdtest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ func createAnotherUserRetry(t testing.TB, client *codersdk.Client, organizationI
700700
require.NoError(t, err)
701701

702702
var sessionToken string
703-
if req.DisableLogin || req.UserLoginType == codersdk.LoginTypeNone {
703+
if req.UserLoginType == codersdk.LoginTypeNone {
704704
// Cannot log in with a disabled login user. So make it an api key from
705705
// the client making this user.
706706
token, err := client.CreateToken(context.Background(), user.ID.String(), codersdk.CreateTokenRequest{

coderd/userauth_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,6 @@ func TestUserLogin(t *testing.T) {
106106
require.ErrorAs(t, err, &apiErr)
107107
require.Equal(t, http.StatusUnauthorized, apiErr.StatusCode())
108108
})
109-
// Password auth should fail if the user is made without password login.
110-
t.Run("DisableLoginDeprecatedField", func(t *testing.T) {
111-
t.Parallel()
112-
client := coderdtest.New(t, nil)
113-
user := coderdtest.CreateFirstUser(t, client)
114-
anotherClient, anotherUser := coderdtest.CreateAnotherUserMutators(t, client, user.OrganizationID, nil, func(r *codersdk.CreateUserRequestWithOrgs) {
115-
r.Password = ""
116-
r.DisableLogin = true
117-
})
118-
119-
_, err := anotherClient.LoginWithPassword(context.Background(), codersdk.LoginWithPasswordRequest{
120-
Email: anotherUser.Email,
121-
Password: "SomeSecurePassword!",
122-
})
123-
require.Error(t, err)
124-
})
125109

126110
t.Run("LoginTypeNone", func(t *testing.T) {
127111
t.Parallel()

codersdk/users_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ func TestCreateUserRequestJSON(t *testing.T) {
114114
Name: coderdtest.RandomName(t),
115115
Password: "",
116116
UserLoginType: codersdk.LoginTypePassword,
117-
DisableLogin: false,
118117
OrganizationIDs: []uuid.UUID{uuid.New(), uuid.New()},
119118
}
120119
marshalTest(t, req)
@@ -129,7 +128,6 @@ func TestCreateUserRequestJSON(t *testing.T) {
129128
Name: coderdtest.RandomName(t),
130129
Password: "",
131130
UserLoginType: codersdk.LoginTypePassword,
132-
DisableLogin: false,
133131
OrganizationIDs: []uuid.UUID{uuid.New()},
134132
}
135133
marshalTest(t, req)
@@ -144,7 +142,6 @@ func TestCreateUserRequestJSON(t *testing.T) {
144142
Name: coderdtest.RandomName(t),
145143
Password: "",
146144
UserLoginType: codersdk.LoginTypePassword,
147-
DisableLogin: false,
148145
OrganizationIDs: []uuid.UUID{},
149146
}
150147
marshalTest(t, req)

0 commit comments

Comments
 (0)