leo
ae5c4f1dd4
All checks were successful
continuous-integration/drone/push Build is passing
* add tmpl * add handler for route /manage/user/:id * add convenience helper func * handle not found/invalid uuid errors
29 lines
1.2 KiB
Go
29 lines
1.2 KiB
Go
// Copyright 2023 wanderer <a_mirre at utb dot cz>
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
package handlers
|
|
|
|
type userSignin struct {
|
|
Username string `form:"username" json:"username" validate:"required,username"`
|
|
Password string `form:"password" json:"password" validate:"required,password"`
|
|
}
|
|
|
|
type userSignup struct {
|
|
Username string `form:"username" json:"username" validate:"required,username"`
|
|
Email string `form:"email" json:"email" validate:"required,email"`
|
|
Password string `form:"password" json:"password" validate:"required,password"`
|
|
}
|
|
|
|
type userCreate struct {
|
|
Username string `form:"username" json:"username" validate:"required,username"`
|
|
Email string `form:"email" json:"email" validate:"required,email"`
|
|
Password string `form:"password" json:"password" validate:"required,password"`
|
|
RepeatPassword string `form:"repeatPassword" json:"repeatPassword" validate:"required,repeatPassword"`
|
|
IsAdmin bool `form:"isAdmin" json:"isAdmin" validate:"required,isAdmin"`
|
|
IsActive *bool `form:"isActive" json:"isActive" validate:"omitempty,isActive"`
|
|
}
|
|
|
|
type userID struct {
|
|
ID string `param:"id" validate:"required,id"`
|
|
}
|