feat: new general and auth errors;
feat: NewPointer helper function in utils; refactor: length validation in auth models
This commit is contained in:
@@ -28,9 +28,8 @@ type RegistrationBeginRequest struct {
|
||||
Password string `json:"password" binding:"required"` // TODO: password checking
|
||||
}
|
||||
|
||||
// TODO: length check
|
||||
type RegistrationCompleteRequest struct {
|
||||
Username string `json:"username" binding:"required"`
|
||||
Username string `json:"username" binding:"required,min=3,max=20"`
|
||||
VerificationCode string `json:"verification_code" binding:"required"`
|
||||
Name string `json:"name" binding:"required,max=75"`
|
||||
Birthday *string `json:"birthday"`
|
||||
@@ -41,10 +40,9 @@ type RegistrationCompleteResponse struct {
|
||||
Tokens
|
||||
}
|
||||
|
||||
// TODO: length check
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username" binding:"required"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
Username string `json:"username" binding:"required,min=3,max=20"`
|
||||
Password string `json:"password" binding:"required,max=100"`
|
||||
TOTP *string `json:"totp"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user