# `HaAuth.Pairings`
[🔗](https://github.com/drselump14/ha_auth/blob/v0.1.0/lib/ha_auth/pairings.ex#L1)

QR sign-in. The login page holds a code (in its session) and shows
`/pair/<code>` as a QR code; a signed-in phone opens it and approves,
which hands the phone's user to that page. Codes live 10 minutes, are
approved once and taken once. Approval is broadcast on `topic/1`, so the
waiting page moves on at once.

# `approve`

`user` (from the phone's session) signs in the page holding `code`.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `create`

A new pending code.

# `pending?`

Is `code` waiting for a phone?

# `start_link`

# `take`

The user who approved `code`, once; `:error` if not approved or expired.

# `topic`

# `ttl_ms`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
