2021-08-18 20:18:39 +02:00
|
|
|
package form
|
|
|
|
|
2022-04-15 09:42:07 +02:00
|
|
|
import "github.com/photoprism/photoprism/pkg/clean"
|
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 {
|
2022-09-02 21:30:50 +02:00
|
|
|
Username string `json:"username"`
|
2021-08-18 20:18:39 +02:00
|
|
|
Email string `json:"email"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
}
|
2021-11-12 09:10:15 +01:00
|
|
|
|
2022-09-02 21:30:50 +02:00
|
|
|
// UsernameClean returns the username in lowercase and with whitespace trimmed.
|
|
|
|
func (f UserCreate) UsernameClean() string {
|
|
|
|
return clean.Login(f.Username)
|
2021-11-12 09:10:15 +01:00
|
|
|
}
|