Skip to content

Password change tests depend on oneshot UIA #897

Description

@timedoutuk

Related: #893

func changePassword(t *testing.T, passwordClient *client.CSAPI, oldPassword string, newPassword string) {
t.Helper()
reqBody := client.WithJSONBody(t, map[string]interface{}{
"auth": map[string]interface{}{
"type": "m.login.password",
"identifier": map[string]interface{}{
"type": "m.id.user",
"user": passwordClient.UserID,
},
"password": oldPassword,
},
"new_password": newPassword,
})

The password change helper requires being capable of skipping UIA, which is not spec compliant and causes flaky failures in all tests that use it.

The test also depends on being able to do oneshot UIA as it does not use the helper:

t.Run("After changing password, different sessions can optionally be kept", func(t *testing.T) {
_, sessionOptional := createSession(t, deployment, passwordClient.UserID, password2)
reqBody := client.WithJSONBody(t, map[string]interface{}{
"auth": map[string]interface{}{
"type": "m.login.password",
"identifier": map[string]interface{}{
"type": "m.id.user",
"user": passwordClient.UserID,
},
"password": password2,
},
"new_password": "new_optional_password",
"logout_devices": false,
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions