33 lines
755 B
Go
33 lines
755 B
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type EmailToken struct {
|
|
ID int64 `db:"id" json:"id"`
|
|
UserID int64 `db:"user_id" json:"user_id"`
|
|
Token string `db:"token" json:"token"`
|
|
Type string `db:"type" json:"type"` // verification, reset
|
|
ExpiresAt time.Time `db:"expires_at" json:"expires_at"`
|
|
UsedAt *time.Time `db:"used_at" json:"used_at"`
|
|
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
|
}
|
|
|
|
type ForgotPasswordRequest struct {
|
|
Email string `json:"email"`
|
|
}
|
|
|
|
type ResetPasswordRequest struct {
|
|
Token string `json:"token"`
|
|
NewPassword string `json:"new_password"`
|
|
}
|
|
|
|
type VerifyEmailRequest struct {
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
type ResendVerificationRequest struct {
|
|
Email string `json:"email"`
|
|
}
|