reset

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResetPasswordAPIHandler

type ResetPasswordAPIHandler struct {
	MinimumLengthRequirement int
	HIBP                     hibp.HIBPSettings
}

func (ResetPasswordAPIHandler) ServeHTTP

type ResetPasswordPageHandler

type ResetPasswordPageHandler struct {
	AppName               string
	Styling               pages.LocksmithPageStyling
	EmailAsUsername       bool
	ShowResetStage        bool
	HIBP                  hibp.HIBPSettings
	MinimumPasswordLength int
}

func (ResetPasswordPageHandler) ServeHTTP

type ResetRouterAPIHandler

type ResetRouterAPIHandler struct {
	Database              database.DatabaseAccessor
	SendResetToken        func(token string, user users.LocksmithUserInterface)
	HIBP                  hibp.HIBPSettings
	MinimumPasswordLength int
}

func (ResetRouterAPIHandler) ServeHTTP

Flow: - [ ] User clicks "Forgot password" on login page - [x] User enters their email - [x] Show a screen to the user that "if the account exists, we've sent a link to your email address."

  • [x] Sends POST request to create & dispatch the reset token
  • POST /api/reset-password?email=email

- [x] Create a MAC for the user to access the PUT /api/reset-password endpoint - [x] Send them a Notification with the MAC (we should make the SendMessage a variable on ResetRouterAPIHandler)

  • URL Format: /reset-password/reset?magic=<MAC>

- [x] User will enter their new password - [x] Password will be changed

  • [x] MAC is expired
  • PUT /api/reset-password { email: email }

- [x] Redirect to /login

Jump to

Keyboard shortcuts

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