Learners get email/SMS OTP codes via /user/sendResetCode; team members get reset links via new /team/sendResetCode and /team/resetPassword APIs, with admin panel integration docs. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
647 B
Go
28 lines
647 B
Go
package domain
|
|
|
|
import "time"
|
|
|
|
// TeamOtp stores password-reset OTPs for team_members (admin panel).
|
|
type TeamOtp struct {
|
|
ID int64
|
|
TeamMemberID int64
|
|
SentTo string
|
|
Medium OtpMedium
|
|
For OtpFor
|
|
Otp string
|
|
Used bool
|
|
UsedAt time.Time
|
|
CreatedAt time.Time
|
|
ExpiresAt time.Time
|
|
}
|
|
|
|
type TeamSendPasswordResetReq struct {
|
|
Email string `json:"email" validate:"required,email"`
|
|
}
|
|
|
|
type TeamResetPasswordReq struct {
|
|
Email string `json:"email" validate:"required,email"`
|
|
Otp string `json:"otp" validate:"required"`
|
|
Password string `json:"password" validate:"required,min=8"`
|
|
}
|