email

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service handles email-related flows: verification, password reset, magic links. For MVP, it logs emails to stdout. Production should integrate SMTP/SendGrid/SES.

func NewService

func NewService(pool *pgxpool.Pool, issuerURL string) *Service

func (*Service) ResetPassword

func (s *Service) ResetPassword(ctx context.Context, token, newPassword string) error

ResetPassword changes the password using a reset token.

func (s *Service) SendMagicLink(ctx context.Context, email string) error

SendMagicLink creates a one-time login token and "sends" an email.

func (*Service) SendPasswordResetEmail

func (s *Service) SendPasswordResetEmail(ctx context.Context, email string) error

SendPasswordResetEmail creates a reset token and "sends" an email.

func (s *Service) ValidateMagicLink(ctx context.Context, token string) (string, error)

ValidateMagicLink validates a magic link token and returns the user ID.

func (*Service) VerifyEmail

func (s *Service) VerifyEmail(ctx context.Context, token string) error

VerifyEmail confirms an email address using the token.

Jump to

Keyboard shortcuts

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