Skip to content
rw3iss Auth

AuthResponse

class rw3iss\AuthServer\Domain\AuthResponse src/Domain/AuthResponse.php ↗

Response from /auth/login, /auth/register, /auth/refresh, /auth/sso/exchange.

Wire shape (auth-server/internal/api/dto/auth.go LoginResponse): { user?, organization?, tokens?, roles?, permissions?, requires_2fa? }

The tokens field is null when requiresTwoFactor is true.

Methods

__construct()

function __construct(
public readonly ?array $user,
public readonly ?array $organization,
public readonly ?TokenPair $tokens,
public readonly array $roles,
public readonly array $permissions,
public readonly bool $requiresTwoFactor,
)

Parameters

  • $user — array<string,mixed>|null
  • $organization — array<string,mixed>|null
  • $roles — list<string>
  • $permissions — list<string>

fromArray()

function fromArray(array $row): self

Parameters

  • $row — array<string,mixed>