Skip to content
Corex

AuthGateway

Corex\Profile\Account\AuthGateway · interface · Add-ons layer

The seam over WordPress authentication. All WordPress-specific calls (wp_signon, wp_insert_user, retrieve_password, reset flow, wp_update_user) live behind this interface so {@see AccountService} stays pure and unit-testable. Implementations must never expose passwords, reset keys, or session tokens in a returned result.

Whether an account would have exactly this username. A gateway that would store a different one in its place answers false, so the person is asked for another.

The login of an account registered with no username. It is the address, unless an account cannot have that address as its login: then it is one made from the address that no account has. An empty string when none can be made, and the person is asked for a username.

createUser(string $email, string $login, string $password, string $name): AccountResult

Section titled “createUser(string $email, string $login, string $password, string $name): AccountResult”

authenticate(string $login, string $password, bool $remember): AccountResult

Section titled “authenticate(string $login, string $password, bool $remember): AccountResult”

requestPasswordReset(string $login): AccountResult

Section titled “requestPasswordReset(string $login): AccountResult”

resetPassword(string $key, string $login, string $password): AccountResult

Section titled “resetPassword(string $key, string $login, string $password): AccountResult”

A display name as an account would hold it. A name is cleaned on its way in, and what is kept can be longer than what was typed; whether a name fits is asked of this text.

updateProfile(int $userId, array $fields): AccountResult

Section titled “updateProfile(int $userId, array $fields): AccountResult”