36 lines
1008 B
Go
36 lines
1008 B
Go
package usecase
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
// CreateRegistrationSessionRequest binds invite + terms before OAuth redirect.
|
|
type CreateRegistrationSessionRequest struct {
|
|
TenantID string
|
|
TenantSlug string
|
|
InviteCode string
|
|
InviteNewUsersOnly bool
|
|
AcceptTermsVersion string
|
|
MarketingOptIn bool
|
|
Language string
|
|
Provider string
|
|
RedirectURI string
|
|
ClientIP string
|
|
UserAgent string
|
|
TTL time.Duration
|
|
}
|
|
|
|
// RegistrationSessionView is returned to clients before OAuth redirect.
|
|
type RegistrationSessionView struct {
|
|
SessionID string
|
|
ExpiresIn int
|
|
}
|
|
|
|
// RegistrationSessionUseCase manages social registration sessions.
|
|
type RegistrationSessionUseCase interface {
|
|
Create(ctx context.Context, req *CreateRegistrationSessionRequest) (*RegistrationSessionView, error)
|
|
Get(ctx context.Context, sessionID string) (*CreateRegistrationSessionRequest, error)
|
|
Delete(ctx context.Context, sessionID string) error
|
|
}
|