feat: Refactor User entity and datasource to use email and password hashing with salt
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package dto
|
||||
|
||||
type AuthDto struct {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
@@ -11,16 +11,15 @@ type UserDto struct {
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
LastEditorID ulid.ULID `json:"lastEditorID"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"` // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
|
||||
Email string `json:"email"`
|
||||
Role string `json:"role"`
|
||||
CompanyID int `json:"companyId"`
|
||||
HourlyRate float64 `json:"hourlyRate"`
|
||||
}
|
||||
|
||||
type UserCreateDto struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"` // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Role string `json:"role"`
|
||||
CompanyID int `json:"companyId"`
|
||||
HourlyRate float64 `json:"hourlyRate"`
|
||||
@@ -31,8 +30,8 @@ type UserUpdateDto struct {
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
LastEditorID *ulid.ULID `json:"lastEditorID"`
|
||||
Username *string `json:"username"`
|
||||
Password *string `json:"password"` // Note: In a real application, you would NEVER send the password in a DTO. This is just for demonstration.
|
||||
Email *string `json:"email"`
|
||||
Password *string `json:"password"`
|
||||
Role *string `json:"role"`
|
||||
CompanyID *int `json:"companyId"`
|
||||
HourlyRate *float64 `json:"hourlyRate"`
|
||||
|
||||
Reference in New Issue
Block a user