Skip to content

Commit

Permalink
fix: allow underscores in form esrvcId validation
Browse files Browse the repository at this point in the history
  • Loading branch information
karrui committed Jul 29, 2021
1 parent 027a399 commit 1e7f725
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/models/form.server.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ const compileFormModel = (db: Mongoose): IFormModel => {
type: String,
required: false,
validate: [
/^([a-zA-Z0-9-]){1,25}$/i,
'e-service ID must be alphanumeric, dashes are allowed',
/^([a-zA-Z0-9-_]){1,25}$/i,
'e-service ID must be alphanumeric, underscores and dashes are allowed',
],
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
name="esrvcId"
ng-model="tempForm.esrvcId"
placeholder="{{ ['SP', 'MyInfo'].includes(type.val) ? 'Enter Singpass e-service ID' : 'Enter Corppass e-service ID' }}"
ng-pattern="/^([a-zA-Z0-9\-]){1,25}$/i"
ng-pattern="/^([a-zA-Z0-9\-\_]){1,25}$/i"
ng-keyup="($event.keyCode === 13 && settingsForm.esrvcId.$valid) && saveForm()"
ng-blur="(settingsForm.esrvcId.$valid) && saveForm()"
ng-disabled="(isFormPublic() && !isPublicWithoutEsrvcId())"
Expand Down

0 comments on commit 1e7f725

Please sign in to comment.