PhoenixLens.Auth (phoenix_lens v0.1.4)

Copy Markdown View Source

Optional Lens lock: authenticator-app TOTP and WebAuthn passkeys.

When either is enabled, the UI asks for a second factor at /unlock. MCP tokens are unaffected. Disable everything from IEx with reset!/0 if you lock yourself out.

Summary

Functions

auth_sql()

authenticate_passkey(attrs, challenge)

authentication_challenge(origin)

cancel_totp_setup()

challenge_bytes(arg1)

confirm_totp(code)

consume_unlock_ticket(token)

disable_totp(code)

ensure_tables()

issue_unlock_ticket(opts \\ [])

origin_from(origin, fallback)

WebAuthn origin from the browser (window.location.origin), falling back to the endpoint URL. Must match the page origin exactly, including port.

otpauth_uri(secret)

passkeys()

passkeys_sql()

qr_svg(secret)

register_passkey(name, attrs, challenge)

registration_challenge(origin)

required?()

reset!()

revoke_passkey(id)

rp_id(origin)

start_totp()

totp_enabled?()

totp_pending?()

verify_totp(code)