You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/src/trezor/ui/layouts/tt/webauthn.py

35 lines
1.1 KiB

from trezor import ui, wire
from trezor.enums import ButtonRequestType
from ...components.common.confirm import is_confirmed
from ...components.common.webauthn import ConfirmInfo
from ...components.tt.confirm import Confirm, ConfirmPageable, Pageable
from ...components.tt.text import Text
from ...components.tt.webauthn import ConfirmContent
from ..common import interact
async def confirm_webauthn(
ctx: wire.GenericContext | None,
info: ConfirmInfo,
pageable: Pageable | None = None,
) -> bool:
if pageable is not None:
confirm: ui.Layout = ConfirmPageable(pageable, ConfirmContent(info))
else:
confirm = Confirm(ConfirmContent(info))
if ctx is None:
return is_confirmed(await confirm)
else:
return is_confirmed(
await interact(ctx, confirm, "confirm_webauthn", ButtonRequestType.Other)
)
async def confirm_webauthn_reset() -> bool:
text = Text("FIDO2 Reset", ui.ICON_CONFIG)
text.normal("Do you really want to")
text.bold("erase all credentials?")
return is_confirmed(await Confirm(text))