forked from baron/baron-sso
93 lines
2.7 KiB
Go
93 lines
2.7 KiB
Go
package domain
|
|
|
|
type EnchantedLinkInitRequest struct {
|
|
LoginID string `json:"loginId"`
|
|
URI string `json:"uri,omitempty"` // Redirect URI (optional for polling flow)
|
|
Method string `json:"method,omitempty"` // "email" or "sms"
|
|
CodeOnly bool `json:"codeOnly,omitempty"`
|
|
}
|
|
|
|
type EnchantedLinkInitResponse struct {
|
|
LinkID string `json:"linkId"`
|
|
PendingRef string `json:"pendingRef"`
|
|
MaskedEmail string `json:"maskedEmail"`
|
|
}
|
|
|
|
type EnchantedLinkPollRequest struct {
|
|
PendingRef string `json:"pendingRef"`
|
|
}
|
|
|
|
type EnchantedLinkPollResponse struct {
|
|
SessionToken string `json:"sessionToken"` // JWT
|
|
RefreshToken string `json:"refreshToken"`
|
|
UserID string `json:"userId,omitempty"`
|
|
}
|
|
|
|
type MagicLinkVerifyRequest struct {
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
type QRInitResponse struct {
|
|
QRCode string `json:"qrCode"` // Base64 or URL
|
|
PendingRef string `json:"pendingRef"`
|
|
ExpiresIn int `json:"expiresIn"`
|
|
}
|
|
|
|
// Signup Flow Models
|
|
|
|
type CheckEmailRequest struct {
|
|
Email string `json:"email"`
|
|
}
|
|
|
|
type SendSignupCodeRequest struct {
|
|
Target string `json:"target"` // Email or Phone
|
|
Type string `json:"type"` // "email" or "phone"
|
|
}
|
|
|
|
type VerifySignupCodeRequest struct {
|
|
Target string `json:"target"` // Email or Phone
|
|
Type string `json:"type"` // "email" or "phone"
|
|
Code string `json:"code"`
|
|
}
|
|
|
|
type SignupRequest struct {
|
|
Email string `json:"email"`
|
|
Password string `json:"password"`
|
|
Name string `json:"name"`
|
|
Phone string `json:"phone"`
|
|
AffiliationType string `json:"affiliationType"` // "AFFILIATE" or "GENERAL"
|
|
CompanyCode string `json:"companyCode,omitempty"`
|
|
Department string `json:"department"`
|
|
TermsAccepted bool `json:"termsAccepted"`
|
|
}
|
|
|
|
// User Profile Models
|
|
|
|
type UserProfileResponse struct {
|
|
ID string `json:"id"`
|
|
Email string `json:"email"`
|
|
Name string `json:"name"`
|
|
Phone string `json:"phone"`
|
|
Department string `json:"department"`
|
|
AffiliationType string `json:"affiliationType"`
|
|
CompanyCode string `json:"companyCode,omitempty"`
|
|
}
|
|
|
|
type UpdateUserRequest struct {
|
|
Name string `json:"name"`
|
|
Phone string `json:"phone"`
|
|
Department string `json:"department"`
|
|
VerificationCode string `json:"verificationCode,omitempty"` // For phone change
|
|
}
|
|
|
|
// PasswordResetInitiateRequest is the request body for initiating a password reset.
|
|
type PasswordResetInitiateRequest struct {
|
|
LoginID string `json:"loginId"`
|
|
}
|
|
|
|
// PasswordResetCompleteRequest is the request body for completing a password reset.
|
|
type PasswordResetCompleteRequest struct {
|
|
LoginID string `json:"loginId"`
|
|
NewPassword string `json:"newPassword"`
|
|
}
|