Skip to content

Commit

Permalink
BE-812 Updated username validation message and rules (#170)
Browse files Browse the repository at this point in the history
Signed-off-by: jeeva <jeevasang@gmail.com>
  • Loading branch information
JeevaSang authored Aug 21, 2020
1 parent 33995ec commit 7be8ad3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/model/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ const attributes = {
allowNull: false,
unique: true,
validate: {
is: /^[a-z0-9_-]+$/i
is: {
args: /^[a-z0-9_-]+$/i,
msg:
'Username allows only lowercase alphanumeric characters with hyphen and underscore Ex:(a-z0-9_-)'
}
}
},
email: {
type: Sequelize.STRING,
validate: {
isEmail: true
isEmail: {
args: true,
msg: 'Invalid email format'
}
}
},
networkName: {
Expand Down

0 comments on commit 7be8ad3

Please sign in to comment.