Documentation
¶
Index ¶
- type Config
- type ErrorResponse
- type Handler
- type Plugin
- func (p *Plugin) ID() string
- func (p *Plugin) Init(authInst core.Authsome) error
- func (p *Plugin) Migrate() error
- func (p *Plugin) RegisterHooks(_ *hooks.HookRegistry) error
- func (p *Plugin) RegisterRoutes(router forge.Router) error
- func (p *Plugin) RegisterServiceDecorators(_ *registry.ServiceRegistry) error
- type PluginOption
- type SendRequest
- type SendResponse
- type Service
- type VerifyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ExpiryMinutes is the magic link expiry time in minutes
ExpiryMinutes int `json:"expiryMinutes"`
// BaseURL is the base URL for magic link generation
BaseURL string `json:"baseURL"`
// AllowImplicitSignup allows creating users if they don't exist
AllowImplicitSignup bool `json:"allowImplicitSignup"`
// RateLimitPerHour is the max requests per hour per user
RateLimitPerHour int `json:"rateLimitPerHour"`
DevExposeURL bool `json:"devExposeURL"`
}
Config holds the magic link plugin configuration
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default magic link plugin configuration
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func NewPlugin ¶
func NewPlugin(opts ...PluginOption) *Plugin
NewPlugin creates a new magic link plugin instance with optional configuration
func (*Plugin) RegisterHooks ¶
func (p *Plugin) RegisterHooks(_ *hooks.HookRegistry) error
func (*Plugin) RegisterServiceDecorators ¶
func (p *Plugin) RegisterServiceDecorators(_ *registry.ServiceRegistry) error
type PluginOption ¶
type PluginOption func(*Plugin)
PluginOption is a functional option for configuring the magic link plugin
func WithAllowImplicitSignup ¶
func WithAllowImplicitSignup(allow bool) PluginOption
WithAllowImplicitSignup sets whether implicit signup is allowed
func WithBaseURL ¶
func WithBaseURL(url string) PluginOption
WithBaseURL sets the base URL for magic links
func WithDefaultConfig ¶
func WithDefaultConfig(cfg Config) PluginOption
WithDefaultConfig sets the default configuration for the plugin
func WithExpiryMinutes ¶
func WithExpiryMinutes(minutes int) PluginOption
WithExpiryMinutes sets the magic link expiry time
func WithRateLimitPerHour ¶
func WithRateLimitPerHour(limit int) PluginOption
WithRateLimitPerHour sets the rate limit per hour
type SendRequest ¶
type SendRequest struct {
Email string `json:"email" validate:"required,email" example:"user@example.com"`
}
Request types
type SendResponse ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
type VerifyResponse ¶
type VerifyResponse = responses.VerifyResponse
Click to show internal directories.
Click to hide internal directories.