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.
Public API
Section titled “Public API”registrationOpen(): bool
Section titled “registrationOpen(): bool”emailExists(string $email): bool
Section titled “emailExists(string $email): bool”usernameExists(string $login): bool
Section titled “usernameExists(string $login): bool”acceptsUsername(string $username): bool
Section titled “acceptsUsername(string $username): bool”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.
loginForAddress(string $email): string
Section titled “loginForAddress(string $email): string”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”displayNameAsKept(string $name): string
Section titled “displayNameAsKept(string $name): string”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.