1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 05:00:10 +00:00

update 'submit logic' portion of storybook docs

This commit is contained in:
rr-bw
2025-04-26 14:45:43 -07:00
parent 8c7b4d788b
commit 04272a2824

View File

@@ -9,7 +9,7 @@ import * as stories from "./input-password.stories.ts";
The `InputPasswordComponent` allows a user to enter master password related credentials. On form
submission, the component creates cryptographic properties (`newMasterKey`,
`newServerMasterKeyHash`, etc.) and emits those properties to the parent (along with the other
values found in `PasswordInputResult`).
values defined in `PasswordInputResult`).
The component is intended for re-use in different scenarios throughout the application. Therefore it
is mostly presentational and simply emits values rather than acting on them itself. It is the job of
@@ -180,14 +180,15 @@ Additional submit logic validation ensures that:
When the form is submitted, the `InputPasswordComponent` does the following in order:
1. If the user selected the checkbox to check for password breaches, they will recieve a popup
dialog if their entered password is found in a breach. The popup will give them the option to
continue with the password or to back out and choose a different password.
2. If there is a master password policy being enforced by an org, it will check to make sure the
entered master password meets the policy requirements.
3. The component will use the password, email, and kdfConfig to create cryptographic properties.
4. The component will emit the following values (defined in the `PasswordInputResult` interface) to
be used by the parent component as needed:
1. Verifies inputs:
- Checks that the current password is correct (if it was required in the flow)
- Checks if the new password is found in a breach and warns the user if so (if the user selected
the checkbox)
- Checks that the new password meets any master password policy requirements enforced by an org
2. Uses the form inputs to create cryptographic properties (`newMasterKey`,
`newServerMasterKeyHash`, etc.)
3. Emits those cryptographic properties up to the parent (along with other values defined in
`PasswordInputResult`) to be used by the parent as needed.
```typescript
export interface PasswordInputResult {