refactor/fix: now using pgx errors for postgres error checking instead of trying to look up the error code;
feat: implemented working custom validation; fix: authservice begin/complete registration
This commit is contained in:
@@ -23,13 +23,13 @@ type Tokens struct {
|
||||
}
|
||||
|
||||
type RegistrationBeginRequest struct {
|
||||
Username string `json:"username" binding:"required,min=3,max=20"`
|
||||
Username string `json:"username" binding:"required,min=3,max=20" validate:"username"`
|
||||
Email *string `json:"email" binding:"email"`
|
||||
Password string `json:"password" binding:"required"` // TODO: password checking
|
||||
}
|
||||
|
||||
type RegistrationCompleteRequest struct {
|
||||
Username string `json:"username" binding:"required,min=3,max=20"`
|
||||
Username string `json:"username" binding:"required,min=3,max=20" validate:"username"`
|
||||
VerificationCode string `json:"verification_code" binding:"required"`
|
||||
Name string `json:"name" binding:"required,max=75"`
|
||||
Birthday *string `json:"birthday"`
|
||||
@@ -41,7 +41,7 @@ type RegistrationCompleteResponse struct {
|
||||
}
|
||||
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username" binding:"required,min=3,max=20"`
|
||||
Username string `json:"username" binding:"required,min=3,max=20" validate:"username"`
|
||||
Password string `json:"password" binding:"required,max=100"`
|
||||
TOTP *string `json:"totp"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user