Skip to content

Commit

Permalink
fix: email address validation for longer TLD and reset message on clo…
Browse files Browse the repository at this point in the history
…se for admin create user (#1958)
  • Loading branch information
ashwiniHerle committed Jun 3, 2024
1 parent c6b6169 commit 5c3c55e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/packs/src/apps/admin/UserManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const handleResetPassword = (id, random, handleShowAlert) => {
});
};

const validateEmail = (mail) => (/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(mail));
const validateEmail = (mail) => (/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,63})+$/.test(mail));
const editTooltip = <Tooltip id="inchi_tooltip">Edit user info</Tooltip>;
const resetPasswordTooltip = <Tooltip id="assign_button">Reset password</Tooltip>;
const resetPasswordInstructionsTooltip = <Tooltip id="assign_button">Send password instructions</Tooltip>;
Expand Down Expand Up @@ -211,13 +211,15 @@ export default class UserManagement extends React.Component {

handleNewUserShow() {
this.setState({
showNewUserModal: true
showNewUserModal: true,
messageNewUserModal: ''
});
}

handleNewUserClose() {
this.setState({
showNewUserModal: false
showNewUserModal: false,
messageNewUserModal: ''
});
}

Expand Down Expand Up @@ -779,7 +781,9 @@ export default class UserManagement extends React.Component {
Email:
</Col>
<Col sm={9}>
<FormControl type="email" name="email" inputRef={(ref) => { this.email = ref; }} />
<FormControl type="email" name="email" inputRef={(ref) => { this.email = ref; }}
maxLength={120}
/>
</Col>
</FormGroup>
<FormGroup controlId="formControlPassword">
Expand Down

0 comments on commit 5c3c55e

Please sign in to comment.