View Source WebauthnComponents.SupportComponent (WebauthnComponents v0.3.2)

A LiveComponent for detecting WebAuthn support.

This component should be used in combination with RegistrationComponent and AuthenticationComponent to disable their buttons when WebAuthn is not supported or enabled.

An application may also use SupportComponent to steer users away from traditional authentication to the more secure Passkey authentication method. For example, an application that supports both traditional authentication and Passkeys may redirect users to a Passkey LiveView or render a message encouraging the new authentication method.

See USAGE.md for example code.

assigns

Assigns

  • @id (Optional) An HTML element ID.
  • @passkeys_supported: (Internal) A boolean indicating the client does or does not support the WebAuthn API.

events

Events

  • "passkeys-supported": Sent by the client when Passkey support has been checked.

messages

Messages

  • {:passkeys_supported, boolean}
    • boolean will be true when WebAuthn is supported and enabled, and false when it is not supported or enabled.

Link to this section Summary

Link to this section Functions

Link to this function

handle_event(event, payload, socket)

View Source

Callback implementation for Phoenix.LiveComponent.handle_event/3.

Callback implementation for Phoenix.LiveComponent.mount/1.

Callback implementation for Phoenix.LiveComponent.render/1.