ResetConfig - ml-archive/reset GitHub Wiki

ResetConfig

public struct ResetConfig<U: JWTAuthenticatable & PasswordResettable>: Service

Inheritance

Service

Initializers

init(name:baseURL:endpoints:signer:responses:controller:)

Creates a new PasswordReset configuration.

public init(name: String, baseURL: String, endpoints: ResetEndpoints = .default, signer: JWTSigner, responses: ResetResponses<U> = .default, controller: ResetControllerType = ResetController<U>())

Parameters

  • name: the name of your project.
  • baseURL: the base url of your project. Used for generating reset password links.
  • endpoints: determines the endpoints for the routes
  • signer: signer and expiration period for password reset tokens.
  • responses: contains the responses to be returned when requesting the endpoints.
  • controller: contains logic for handling the reset password flow.

Properties

baseURL

let baseURL: String

controller

let controller: ResetControllerType

endpoints

let endpoints: ResetEndpoints

name

let name: String

responses

let responses: ResetResponses<U>

signer

let signer: JWTSigner

Methods

extractVerifiedPayload(from:)

func extractVerifiedPayload(from token: String) throws -> U.JWTPayload

reset(_:context:on:)

func reset<T: PasswordResettable>(_ object: T, context: T.Context, on req: Request) throws -> Future<Void>
⚠️ **GitHub.com Fallback** ⚠️