Sign-in rules: tests that change their own password send the current one; field labels en/pl; the hook carries a mark
Tests and the late-staff built-site spec that change an account's OWN
password now send currentPassword (the 1.18.0 rule). The Current password
field's label and description are plain { en, pl } (house style checked by
the wording test). The beforeOperation hook carries SIGN_IN_RULES_MARK so
the password-rule hook counts stay what they measure. The injected users
collection carries Payload's lock defaults (50, 1 h).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
52710021ef
commit
420fe40442
@@ -91,7 +91,8 @@ test.describe('a late staff collection on a built site', () => {
|
||||
}]).toEqual([slug, { create: 403, integrations: 403, patch: 403, users: 403, zDelete: 403 }])
|
||||
await api.patch(`/api/${slug}/${itsUserId}`, { data: { roles: ['admin'] } })
|
||||
expect((await (await admin.get(`/api/${slug}/${itsUserId}`)).json()).roles, `${slug}: its own roles`).toEqual(['user'])
|
||||
expect((await api.patch(`/api/${slug}/${itsUserId}`, { data: { password: `own-${PASSWORD}` } })).status(), `${slug}: its own password`).toBe(200)
|
||||
// 1.18.0: with the current password (accounts.confirmOwnChanges)
|
||||
expect((await api.patch(`/api/${slug}/${itsUserId}`, { data: { currentPassword: PASSWORD, password: `own-${PASSWORD}` } })).status(), `${slug}: its own password`).toBe(200)
|
||||
for (const id of [itsAdminId, itsUserId]) {expect((await admin.delete(`/api/${slug}/${id}`)).status()).toBe(200)}
|
||||
await api.dispose()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user