Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit714e316

Browse files
test: ensure login fails before changing password
1 parentb89dfd7 commit714e316

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎coderd/userauth_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,15 @@ func TestUserForgotPassword(t *testing.T) {
16821682

16831683
anotherClient,anotherUser:=coderdtest.CreateAnotherUser(t,client,user.OrganizationID)
16841684

1685-
err:=anotherClient.RequestOneTimePasscode(ctx, codersdk.RequestOneTimePasscodeRequest{
1685+
// First try to login before changing our password. We expected this to error
1686+
// as we haven't change the password yet.
1687+
_,err:=anotherClient.LoginWithPassword(ctx, codersdk.LoginWithPasswordRequest{
1688+
Email:anotherUser.Email,
1689+
Password:newPassword,
1690+
})
1691+
require.Error(t,err)
1692+
1693+
err=anotherClient.RequestOneTimePasscode(ctx, codersdk.RequestOneTimePasscodeRequest{
16861694
Email:anotherUser.Email,
16871695
})
16881696
require.NoError(t,err)
@@ -1701,6 +1709,7 @@ func TestUserForgotPassword(t *testing.T) {
17011709
})
17021710
require.NoError(t,err)
17031711

1712+
// Now that we have changed the password, this should work.
17041713
_,err=anotherClient.LoginWithPassword(ctx, codersdk.LoginWithPasswordRequest{
17051714
Email:anotherUser.Email,
17061715
Password:newPassword,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp