GeneratePasswordResetTokenCommand - ml-archive/reset GitHub Wiki

GeneratePasswordResetTokenCommand

Generates password reset tokens for a user which can be used to reset their password.

public struct GeneratePasswordResetTokenCommand<U: PasswordResettable>: Command

Inheritance

Command

Nested Types

GeneratePasswordResetTokenCommand.GeneratePasswordResetTokenCommand.Keys

Initializers

init(databaseIdentifier:makeFilter:context:)

Creates a new password reset token command with a custom lookup strategy.

public init(databaseIdentifier: DatabaseIdentifier<U.Database>, makeFilter: @escaping (String) -> FilterOperator<U.Database, U>, context: U.Context = U.Context.requestResetPassword())

Example to enable search by email:

GeneratePasswordResetTokenCommand(databaseIdentifier: .mysql) { query in
    try \User.email == $0
}

Parameters

  • databaseIdentifier: identifier of database from where to load the user.
  • makeFilter: used to create the filter from the query.
  • context: The Reset context to use when generating the token.

Properties

arguments

See Command

let arguments: [CommandArgument] = [.argument(name: Keys.query)]

help

See CommandRunnable

let help = ["Generates a password reset token for a user with a given id."]

options

See CommandRunnable

let options: [CommandOption] = []

Methods

run(using:)

See CommandRunnable

public func run(using context: CommandContext) throws -> Future<Void>
⚠️ **GitHub.com Fallback** ⚠️