Skip to content

Commit

Permalink
feat(webauthn): update messages and nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Mar 7, 2022
1 parent 1209eda commit 22534d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions selfservice/strategy/webauthn/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"encoding/base64"
"fmt"

"github.com/ory/x/stringsx"

"github.com/ory/kratos/text"
"github.com/ory/kratos/ui/node"
)
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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))
}

0 comments on commit 22534d8

Please sign in to comment.