Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailSender ¶
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 ¶
RequestReset handles POST /api/request-reset-password. ユーザーが見つからない/email不一致/未認証でも成功レスポンスを返す(情報漏洩防止)。
func (*Handler) SetEmailSender ¶
func (h *Handler) SetEmailSender(s EmailSender)
SetEmailSender attaches an EmailSender for sending reset emails.
func (*Handler) SetPasswordHasher ¶
SetPasswordHasher sets the Hasher that the new password is hashed with. Unset, the default cost is used.
func (*Handler) SetServerURL ¶
SetServerURL sets the base URL for reset links.