HaAuth.Pairings (ha_auth v0.1.0)

Copy Markdown View Source

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.

Summary

Functions

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

Returns a specification to start this module under a supervisor.

A new pending code.

Is code waiting for a phone?

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

Functions

approve(code, user)

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

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

create()

A new pending code.

pending?(code)

Is code waiting for a phone?

start_link(opts)

take(code)

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

topic(code)

ttl_ms()