mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
06e8619a37
Align channel identity and bind flow across backend and app-facing layers, including generated swagger artifacts and package lock updates while excluding docs content changes.
27 lines
927 B
Go
27 lines
927 B
Go
package bind
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
var (
|
|
ErrCodeNotFound = errors.New("bind code not found")
|
|
ErrCodeUsed = errors.New("bind code already used")
|
|
ErrCodeExpired = errors.New("bind code expired")
|
|
ErrCodeMismatch = errors.New("bind code context mismatch")
|
|
ErrLinkConflict = errors.New("channel identity user link conflict")
|
|
)
|
|
|
|
// Code represents a one-time bind code for linking channel identity to user.
|
|
type Code struct {
|
|
ID string `json:"id"`
|
|
Platform string `json:"platform,omitempty"`
|
|
Token string `json:"token"`
|
|
IssuedByUserID string `json:"issued_by_user_id"`
|
|
ExpiresAt time.Time `json:"expires_at,omitempty"`
|
|
UsedAt time.Time `json:"used_at,omitempty"`
|
|
UsedByChannelIdentityID string `json:"used_by_channel_identity_id,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|