Documentation

ValidateApiToken

Use case for validating API tokens.

Tokens are hashed before lookup since only hashes are stored in the database.

Tags
since
3.0.0

Table of Contents

Properties

$repository  : UserRepositoryInterface
User repository.
$tokenHasher  : TokenHasher
Token hasher.

Methods

__construct()  : mixed
Create a new ValidateApiToken use case.
execute()  : User|null
Execute to validate an API token.

Properties

Methods

execute()

Execute to validate an API token.

public execute(string $token) : User|null

The provided plaintext token is hashed before lookup since only hashes are stored in the database.

Parameters
$token : string

The API token to validate (plaintext)

Return values
User|null

The user if token is valid, null otherwise


        
On this page

Search results