Skip to content

Commit 20895b9

Browse files
committed
refactor: refactor user authentication and data validation
- Modify the `Password` field in `CreateUserOption` struct to remove the `Required` tag - Update the `v1_json.tmpl` template to include the `email` field and remove the `password` field Signed-off-by: appleboy <appleboy.tw@gmail.com>
1 parent 9a15267 commit 20895b9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

modules/structs/admin_user.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ type CreateUserOption struct {
1515
FullName string `json:"full_name" binding:"MaxSize(100)"`
1616
// required: true
1717
// swagger:strfmt email
18-
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
19-
// required: true
20-
Password string `json:"password" binding:"Required;MaxSize(255)"`
18+
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
19+
Password string `json:"password" binding:"MaxSize(255)"`
2120
MustChangePassword *bool `json:"must_change_password"`
2221
SendNotify bool `json:"send_notify"`
2322
Restricted *bool `json:"restricted"`

templates/swagger/v1_json.tmpl

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)