Skip to content

Commit

Permalink
refactor: refactor user authentication and data validation
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
appleboy committed Dec 16, 2023
1 parent 9a15267 commit 20895b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions modules/structs/admin_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ type CreateUserOption struct {
FullName string `json:"full_name" binding:"MaxSize(100)"`
// required: true
// swagger:strfmt email
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
// required: true
Password string `json:"password" binding:"Required;MaxSize(255)"`
Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
Password string `json:"password" binding:"MaxSize(255)"`
MustChangePassword *bool `json:"must_change_password"`
SendNotify bool `json:"send_notify"`
Restricted *bool `json:"restricted"`
Expand Down
3 changes: 1 addition & 2 deletions templates/swagger/v1_json.tmpl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 20895b9

Please sign in to comment.