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

  • $userarray<string,mixed>|null
  • $organizationarray<string,mixed>|null
  • $roleslist<string>
  • $permissionslist<string>

fromArray()

function fromArray(array $row): self

Parameters

  • $rowarray<string,mixed>