api

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetCsrfTokenErrors                   = contract.MustOperationErrors("getCsrfToken")
	GetGoogleLoginOptionsErrors          = contract.MustOperationErrors("getGoogleLoginOptions")
	LoginWithGoogleErrors                = contract.MustOperationErrors("loginWithGoogle")
	LoginWithPasswordErrors              = contract.MustOperationErrors("loginWithPassword")
	SignupDirectErrors                   = contract.MustOperationErrors("signupDirect")
	StartSignupChallengeErrors           = contract.MustOperationErrors("startSignupChallenge")
	VerifySignupChallengeErrors          = contract.MustOperationErrors("verifySignupChallenge")
	ResendChallengeErrors                = contract.MustOperationErrors("resendChallenge")
	BeginPasskeyAuthenticationErrors     = contract.MustOperationErrors("beginPasskeyAuthentication")
	FinishPasskeyAuthenticationErrors    = contract.MustOperationErrors("finishPasskeyAuthentication")
	BeginPasskeyRegistrationErrors       = contract.MustOperationErrors("beginPasskeyRegistration")
	FinishPasskeyRegistrationErrors      = contract.MustOperationErrors("finishPasskeyRegistration")
	LogoutErrors                         = contract.MustOperationErrors("logout")
	RefreshSessionErrors                 = contract.MustOperationErrors("refreshSession")
	RefreshTokensErrors                  = contract.MustOperationErrors("refreshTokens")
	GetCurrentUserErrors                 = contract.MustOperationErrors("getCurrentUser")
	ListCurrentUserOrganizationsErrors   = contract.MustOperationErrors("listCurrentUserOrganizations")
	GetCurrentOrganizationErrors         = contract.MustOperationErrors("getCurrentOrganization")
	ListCurrentOrganizationMembersErrors = contract.MustOperationErrors("listCurrentOrganizationMembers")
	SwitchOrganizationErrors             = contract.MustOperationErrors("switchOrganization")
)

Functions

This section is empty.

Types

type APIHandler

type APIHandler struct {
	Auth           *auth.Service
	Passkeys       *passkey.Service
	Session        *session.Service
	Organizations  *organization.Service
	Challenge      *challenge.Service
	Verification   *challenge.VerificationCodeService
	Limiter        ratelimiter.AuthLimiter
	Logger         *slog.Logger
	Google         *google.Client
	OAuthProviders oauth.OAuthProviders

	ChallengeEnabled bool
	AccessTTL        time.Duration
	RefreshTTL       time.Duration
}

func New

func New(
	auth *auth.Service,
	passkeys *passkey.Service,
	session *session.Service,
	organizations *organization.Service,
	challenge *challenge.Service,
	verification *challenge.VerificationCodeService,
	limiter ratelimiter.AuthLimiter,
	logger *slog.Logger,
	google *google.Client,
	oauthProviders oauth.OAuthProviders,
	challengeEnabled bool,
	accessTTL time.Duration,
	refreshTTL time.Duration,
) *APIHandler

func (*APIHandler) FinishPasskeyRegistration added in v0.10.0

func (*APIHandler) GetCsrfToken added in v0.10.0

func (*APIHandler) GetCurrentUser added in v0.10.0

func (*APIHandler) LoginWithGoogle added in v0.10.0

func (*APIHandler) LoginWithPassword added in v0.10.0

func (*APIHandler) Logout added in v0.10.0

func (*APIHandler) RefreshSession added in v0.10.0

func (*APIHandler) RefreshTokens added in v0.10.0

func (*APIHandler) ResendChallenge added in v0.10.0

func (*APIHandler) SignupDirect added in v0.10.0

func (*APIHandler) StartSignupChallenge added in v0.10.0

func (*APIHandler) SwitchOrganization added in v0.10.0

func (*APIHandler) VerifySignupChallenge added in v0.10.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL