Skip to content

Commit e01a887

Browse files
committed
fix(auth): address PR review findings on password reset page
- Sync .env.example password pattern with new config default (adds +, enforces allowed-charset body) and add missing AUTH_PASSWORD_MIN_LENGTH, AUTH_PASSWORD_ALLOWED_SPECIAL_CHARACTERS_TEXT, and AUTH_PASSWORD_SHAPE_LIST keys - Harden shape_list in reset.blade.php with Js::from() to prevent JS parse errors from quotes or backslashes in the config value - Add aria-label to the disabled email field so screen readers announce its accessible name
1 parent 65506e9 commit e01a887

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

.env.example

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ MAIL_SEND_WELCOME_EMAIL=1
110110
DEFAULT_PROFILE_IMAGE=
111111

112112
AUTH_PASSWORD_RESET_LIFETIME=1800
113-
AUTH_PASSWORD_SHAPE_PATTERN="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-])"
114-
AUTH_PASSWORD_SHAPE_WARNING="Password must include at least one uppercase letter, one lowercase letter, one number, and one special character."
113+
AUTH_PASSWORD_MIN_LENGTH=10
114+
AUTH_PASSWORD_SHAPE_PATTERN="^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*+-])[A-Za-z0-9#?!@$%^&*+-]+$"
115+
AUTH_PASSWORD_SHAPE_WARNING="Password must include at least one uppercase letter, one lowercase letter, one number, and one special character (#?!@$%^&*+-)."
116+
AUTH_PASSWORD_ALLOWED_SPECIAL_CHARACTERS_TEXT="#?!@$%^&*+-"
117+
AUTH_PASSWORD_SHAPE_LIST="Uppercase letter,Lowercase letter,One number,Special character"
115118

116119

117120
OAUTH2_VALIDATE_RESOURCE_SERVER_IP=true

resources/js/reset_password/reset_password.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ const ResetPasswordPage = ({
126126
hiddenLabel
127127
value={formik.values.email}
128128
disabled={true}
129+
inputProps={{ 'aria-label': 'Email address' }}
129130
InputProps={{ disableUnderline: true }}
130131
/>
131132
</Grid>

resources/views/auth/passwords/reset.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
allowed_special_characters: '{{ Config::get("auth.password_allowed_special_characters") }}',
2727
allowed_special_characters_text: {{ Illuminate\Support\Js::from(Config::get("auth.password_allowed_special_characters_text")) }},
2828
shape_warning: '{{ Config::get("auth.password_shape_warning") }}',
29-
shape_list: '{{ Config::get("auth.password_shape_list") }}'
29+
shape_list: {{ Illuminate\Support\Js::from(Config::get("auth.password_shape_list")) }}
3030
}
3131
@if ($errors->any())
3232
@foreach($errors->all() as $error)

0 commit comments

Comments
 (0)