Skip to content

Commit 5838a6f

Browse files
committed
feat(password): apply backend logic to all password set fields
1 parent 6a6e867 commit 5838a6f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

coderd/userauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ func (api *API) postChangePasswordWithOneTimePasscode(rw http.ResponseWriter, r
444444
// @Param request body codersdk.ValidateUserPasswordRequest true "Validate user password request"
445445
// @Success 200 {object} codersdk.ValidateUserPasswordResponse
446446
// @Router /users/validate-password [post]
447-
func (api *API) validateUserPassword(rw http.ResponseWriter, r *http.Request) {
447+
func (*API) validateUserPassword(rw http.ResponseWriter, r *http.Request) {
448448
var (
449449
ctx = r.Context()
450450
valid = true

coderd/userpassword/userpassword_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func TestUserPasswordValidate(t *testing.T) {
2626
}
2727

2828
for _, tt := range tests {
29+
tt := tt
2930
t.Run(tt.name, func(t *testing.T) {
3031
t.Parallel()
3132
err := userpassword.Validate(tt.password)
@@ -39,6 +40,7 @@ func TestUserPasswordValidate(t *testing.T) {
3940
}
4041

4142
func TestUserPasswordCompare(t *testing.T) {
43+
t.Parallel()
4244
tests := []struct {
4345
name string
4446
hash string
@@ -54,6 +56,7 @@ func TestUserPasswordCompare(t *testing.T) {
5456
}
5557

5658
for _, tt := range tests {
59+
tt := tt
5760
t.Run(tt.name, func(t *testing.T) {
5861
t.Parallel()
5962
if tt.hash == "" {

0 commit comments

Comments
 (0)