Files
easywish/backend/internal/models/auth.go

43 lines
890 B
Go

package models
type Tokens struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}
type RegistrationBeginRequest struct {
Username string `json:"username"`
Email *string `json:"email"`
Password string `json:"password"` // TODO: password checking
}
type RegistrationCompleteRequest struct {
Username string `json:"username"`
VerificationCode string `json:"verification_code"`
Name string `json:"name"`
Birthday *string `json:"birthday"`
AvatarUrl *string `json:"avatar_url"`
}
type RegistrationCompleteResponse struct {
Tokens
}
type LoginRequest struct {
Username string `json:"username"`
Password string `json:"password"`
TOTP *string `json:"totp"`
}
type LoginResponse struct {
Tokens
}
type RefreshRequest struct {
RefreshToken string `json:"refresh_token"`
}
type RefreshResponse struct {
Tokens
}