Skip to content

Commit

Permalink
fix: add missing autocomplete attributes to identifier_first strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas committed Nov 18, 2024
1 parent 7c24b77 commit 5b67f25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"type": "text",
"value": "",
"required": true,
"autocomplete": "username email",
"disabled": false,
"node_type": "input"
},
Expand Down
6 changes: 5 additions & 1 deletion selfservice/strategy/idfirst/strategy_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow,
if !ok {
continue
}
attrs.Autocomplete = "username email"

attrs.Type = node.InputAttributeTypeHidden
f.UI.Nodes[k].Attributes = attrs
Expand Down Expand Up @@ -184,7 +185,10 @@ func (s *Strategy) PopulateLoginMethodIdentifierFirstIdentification(r *http.Requ
return err
}

f.UI.SetNode(node.NewInputField("identifier", "", s.NodeGroup(), node.InputAttributeTypeText, node.WithRequiredInputAttribute).WithMetaLabel(identifierLabel))
f.UI.SetNode(node.NewInputField("identifier", "", s.NodeGroup(), node.InputAttributeTypeText, node.WithInputAttributes(func(a *node.InputAttributes) {
a.Autocomplete = "username email"
a.Required = true
})).WithMetaLabel(identifierLabel))
f.UI.GetNodes().Append(node.NewInputField("method", s.ID(), s.NodeGroup(), node.InputAttributeTypeSubmit).WithMetaLabel(text.NewInfoNodeLabelContinue()))
return nil
}
Expand Down

0 comments on commit 5b67f25

Please sign in to comment.