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 <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Dec 16, 2023
1 parent b8490d5 commit 966c0b5
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 966c0b5

Please sign in to comment.