You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* {"name"="username", "dataType"="string", "required"=true, "description"="Username should be 3-16 characters long with any lowercase letter (a-z), number (0-9), an underscore, or a hyphen"},
220
+
* {"name"="password", "dataType"="string", "required"=true, "description"="Password should be 8-15 characters long and must contain alphanumeric and @*# characters"},
if ( preg_match($this->container->getParameter('username_regex'), $username ) == false ) {
319
+
$this->logAndThrowError(400, 'Username should be 3-16 characters long with any lowercase letter (a-z), number (0-9), an underscore, or a hyphen.', $this->get('translator')->trans('api.show_error_username_policy', array(), 'messages', $request->getLocale()), $request->getLocale());
320
+
}
317
321
}
318
322
319
323
/**
@@ -326,6 +330,10 @@ private function validatePassword(Request $request) {
if ( preg_match($this->container->getParameter('password_regex'), $password ) == false ) {
335
+
$this->logAndThrowError(400, 'Password should be 8-15 characters long and must contain alphanumeric and @*# characters.', $this->get('translator')->trans('api.show_error_password_policy', array(), 'messages', $request->getLocale()), $request->getLocale());
336
+
}
329
337
}
330
338
331
339
/**
@@ -382,7 +390,7 @@ private function validateDob(Request $request) {
382
390
* description="Change password of the user. Access token to be provided in header (Authorization = Bearer <access token>)",
* {"name"="password", "dataType"="string", "required"=true, "description"="Password should be 8-15 characters long and must contain alphanumeric and @*# characters"},
386
394
* {"name"="_locale", "dataType"="string", "required"=false, "description"="User locale. Will default to en"}
Copy file name to clipboardExpand all lines: src/ApiBundle/Resources/translations/messages.fr.yml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -132,3 +132,5 @@ api:
132
132
show_error_password_reset: Désolé, vous n'êtes pas autorisé à demander une réinitialisation du mot de passe!
133
133
show_error_reset_req: Réinitialisation du mot de passe déjà reçue
134
134
show_error_server_fault: Erreur du serveur! Veuillez réessayer après un certain temps !!
135
+
show_error_username_policy: Le nom d'utilisateur doit comporter entre 3 et 16 caractères avec une lettre minuscule (a-z), un chiffre (0-9), un trait de soulignement ou un tiret
136
+
show_error_password_policy: Le mot de passe doit comporter entre 8 et 15 caractères et contenir des caractères alphanumériques et @*#
0 commit comments