Skip to content

Commit 62f2b77

Browse files
committed
Update comments and constants
1 parent de7987a commit 62f2b77

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/auth/src/core/auth/password_policy_impl.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import {
2323
} from '../../model/password_policy';
2424
import { PasswordValidationStatus } from '../../model/public_types';
2525

26+
// Minimum password length enforced by the backend, even if no minimum length is set.
27+
const MINIMUM_MIN_PASSWORD_LENGTH = 6;
28+
2629
/**
2730
* Stores password policy requirements and provides password validation against the policy.
2831
*
@@ -39,9 +42,9 @@ export class PasswordPolicyImpl implements PasswordPolicyInternal {
3942
// Only include custom strength options defined in the response.
4043
const responseOptions = response.customStrengthOptions;
4144
this.customStrengthOptions = {};
42-
// A minimum length of 6 will be enforced by the backend if no minimum length is set.
45+
// TODO: Remove once the backend is updated to include the minimum min password length instead of undefined when there is no minimum length set.
4346
this.customStrengthOptions.minPasswordLength =
44-
responseOptions.minPasswordLength ?? 6;
47+
responseOptions.minPasswordLength ?? MINIMUM_MIN_PASSWORD_LENGTH;
4548
if (responseOptions.maxPasswordLength) {
4649
this.customStrengthOptions.maxPasswordLength =
4750
responseOptions.maxPasswordLength;

0 commit comments

Comments
 (0)