ResetConfig - ml-archive/reset GitHub Wiki
public struct ResetConfig<U: JWTAuthenticatable & PasswordResettable>: Service
Service
Creates a new PasswordReset configuration.
public init(name: String, baseURL: String, endpoints: ResetEndpoints = .default, signer: JWTSigner, responses: ResetResponses<U> = .default, controller: ResetControllerType = ResetController<U>())
- 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.
let baseURL: String
let controller: ResetControllerType
let endpoints: ResetEndpoints
let name: String
let responses: ResetResponses<U>
let signer: JWTSigner
func extractVerifiedPayload(from token: String) throws -> U.JWTPayload
func reset<T: PasswordResettable>(_ object: T, context: T.Context, on req: Request) throws -> Future<Void>