resetpassword

package
v0.0.0-...-48dcf97 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailSender

type EmailSender func(to string, msg miscsmtp.Message)

EmailSender sends an email message (subject + text + optional HTML). HTML が空なら text/plain only、設定されていれば multipart/alternative で 両方送出される (#600 item 4)。

type Handler

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

Handler handles password reset endpoints.

func NewHandler

func NewHandler(userRepo repository.UserRepository, resetRepo repository.PasswordResetRequestRepository, idGen id.Generator,
	background *bgwork.Group, metaRepo repository.MetaRepository,
) *Handler

NewHandler creates a new password reset Handler. background is the group the work after a response (the reset mail) runs in, so stopping the server generation waits for it (#3661); metaRepo is the meta lookup for the mail's locale fallback.

func (*Handler) RequestReset

func (h *Handler) RequestReset(c *echo.Context) error

RequestReset handles POST /api/request-reset-password. ユーザーが見つからない/email不一致/未認証でも成功レスポンスを返す(情報漏洩防止)。

func (*Handler) Reset

func (h *Handler) Reset(c *echo.Context) error

Reset handles POST /api/reset-password.

func (*Handler) SetEmailSender

func (h *Handler) SetEmailSender(s EmailSender)

SetEmailSender attaches an EmailSender for sending reset emails.

func (*Handler) SetPasswordHasher

func (h *Handler) SetPasswordHasher(hasher password.Hasher)

SetPasswordHasher sets the Hasher that the new password is hashed with. Unset, the default cost is used.

func (*Handler) SetServerURL

func (h *Handler) SetServerURL(u string)

SetServerURL sets the base URL for reset links.

Jump to

Keyboard shortcuts

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