2021-08-18 20:18:39 +02:00
|
|
|
package form
|
|
|
|
|
2021-12-15 12:24:05 +01:00
|
|
|
import "github.com/photoprism/photoprism/pkg/sanitize"
|
2021-11-12 09:10:15 +01:00
|
|
|
|
2021-08-18 20:18:39 +02:00
|
|
|
// UserCreate represents a User with a new password.
|
|
|
|
type UserCreate struct {
|
|
|
|
UserName string `json:"username"`
|
|
|
|
FullName string `json:"fullname"`
|
|
|
|
Email string `json:"email"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
}
|
2021-11-12 09:10:15 +01:00
|
|
|
|
|
|
|
// Username returns the normalized username in lowercase and without whitespace padding.
|
|
|
|
func (f UserCreate) Username() string {
|
2021-12-15 12:24:05 +01:00
|
|
|
return sanitize.Username(f.UserName)
|
2021-11-12 09:10:15 +01:00
|
|
|
}
|