template-monorepo/internal/model/auth/domain/usecase/login_mfa_challenge.go

28 lines
765 B
Go

package usecase
import (
"context"
"time"
)
// CreateLoginMFAChallengeRequest binds tenant/member after password verification.
type CreateLoginMFAChallengeRequest struct {
TenantID string
TenantSlug string
UID string
TTL time.Duration
}
// LoginMFAChallengeView is returned when login requires TOTP confirmation.
type LoginMFAChallengeView struct {
ChallengeID string
ExpiresIn int
}
// LoginMFAChallengeUseCase manages password-login MFA challenges.
type LoginMFAChallengeUseCase interface {
Create(ctx context.Context, req *CreateLoginMFAChallengeRequest) (*LoginMFAChallengeView, error)
Get(ctx context.Context, challengeID string) (*CreateLoginMFAChallengeRequest, error)
Delete(ctx context.Context, challengeID string) error
}