From 22534d8253384f2002033a5b2bbdcf573779a49c Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Wed, 2 Mar 2022 10:08:49 +0100 Subject: [PATCH] feat(webauthn): update messages and nodes --- selfservice/strategy/webauthn/nodes.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/selfservice/strategy/webauthn/nodes.go b/selfservice/strategy/webauthn/nodes.go index 9045f3d0d9f..c112a9da666 100644 --- a/selfservice/strategy/webauthn/nodes.go +++ b/selfservice/strategy/webauthn/nodes.go @@ -6,6 +6,8 @@ import ( "encoding/base64" "fmt" + "github.com/ory/x/stringsx" + "github.com/ory/kratos/text" "github.com/ory/kratos/ui/node" ) @@ -14,8 +16,7 @@ func NewWebAuthnConnectionTrigger(options string) *node.Node { return node.NewInputField(node.WebAuthnRegisterTrigger, "", node.WebAuthnGroup, node.InputAttributeTypeButton, node.WithInputAttributes(func(a *node.InputAttributes) { a.OnClick = "window.__oryWebAuthnRegistration(" + options + ")" - })). - WithMetaLabel(text.NewInfoSelfServiceRegisterWebAuthn()) + })) } func NewWebAuthnScript(src string, contents []byte) *node.Node { @@ -32,8 +33,7 @@ func NewWebAuthnLoginTrigger(options string) *node.Node { return node.NewInputField(node.WebAuthnLoginTrigger, "", node.WebAuthnGroup, node.InputAttributeTypeButton, node.WithInputAttributes(func(a *node.InputAttributes) { a.OnClick = "window.__oryWebAuthnLogin(" + options + ")" - })). - WithMetaLabel(text.NewInfoSelfServiceLoginWebAuthn()) + })) } func NewWebAuthnLoginInput() *node.Node { @@ -49,5 +49,5 @@ func NewWebAuthnConnectionName() *node.Node { func NewWebAuthnUnlink(c *Credential) *node.Node { return node.NewInputField(node.WebAuthnRemove, fmt.Sprintf("%x", c.ID), node.WebAuthnGroup, node.InputAttributeTypeSubmit). - WithMetaLabel(text.NewInfoSelfServiceRemoveWebAuthn(c.DisplayName, c.AddedAt)) + WithMetaLabel(text.NewInfoSelfServiceRemoveWebAuthn(stringsx.Coalesce(c.DisplayName, "unnamed"), c.AddedAt)) }