Increase user full_name max length to 64 characters (#403)

This commit is contained in:
Riccardo Graziosi
2024-09-07 18:10:45 +02:00
committed by GitHub
parent 3c6b885391
commit 5decb702f2
6 changed files with 11 additions and 8 deletions

View File

@@ -73,7 +73,7 @@ const TenantSignUpP = ({
const [goneBack, setGoneBack] = useState(false);
const [userData, setUserData] = useState({
fullName: oAuthLoginCompleted ? oauthUserName : '',
fullName: (oAuthLoginCompleted && oauthUserName) ? oauthUserName.slice(0, 64) : '',
email: oAuthLoginCompleted ? oauthUserEmail : '',
password: '',
passwordConfirmation: '',

View File

@@ -102,13 +102,15 @@ const UserSignUpForm = ({
<div className="formRow">
<input
{...register('fullName', { required: true, minLength: 2 })}
{...register('fullName', { required: true, minLength: 2, maxLength: 64 })}
autoFocus
placeholder={getLabel('user', 'full_name')}
id="userFullName"
className="formControl"
/>
<DangerText>{errors.fullName && getValidationMessage('required', 'user', 'full_name')}</DangerText>
<DangerText>{errors.fullName?.type === 'required' && getValidationMessage('required', 'user', 'full_name')}</DangerText>
<DangerText>{errors.fullName?.type === 'minLength' && (getLabel('user', 'full_name') + ' ' + I18n.t('activerecord.errors.messages.too_short', { count: 2 }))}</DangerText>
<DangerText>{errors.fullName?.type === 'maxLength' && (getLabel('user', 'full_name') + ' ' + I18n.t('activerecord.errors.messages.too_long', { count: 64 }))}</DangerText>
</div>
<div className="formRow">