Skip to content

Commit

Permalink
fix: do not require method to be passkey in settings schema (#3862)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas committed Apr 5, 2024
1 parent 800f8f1 commit 660f330
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion selfservice/strategy/passkey/.schema/settings.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "string"
},
"method": {
"const": "passkey"
"type": "string"
},
"passkey_settings_register": {
"type": "string"
Expand Down
8 changes: 5 additions & 3 deletions selfservice/strategy/passkey/passkey_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ func (s *Strategy) PopulateSettingsMethod(r *http.Request, id *identity.Identity
Attributes: &node.InputAttributes{
Name: node.PasskeySettingsRegister,
Type: node.InputAttributeTypeHidden,
}})
},
})

f.UI.Nodes.Upsert(&node.Node{
Type: node.Input,
Expand All @@ -135,7 +136,8 @@ func (s *Strategy) PopulateSettingsMethod(r *http.Request, id *identity.Identity
Name: node.PasskeyCreateData,
Type: node.InputAttributeTypeHidden,
FieldValue: string(injectWebAuthnOptions),
}})
},
})

return nil
}
Expand All @@ -156,7 +158,7 @@ func (s *Strategy) identityListWebAuthn(id *identity.Identity) (*identity.Creden

func (s *Strategy) Settings(w http.ResponseWriter, r *http.Request, f *settings.Flow, ss *session.Session) (*settings.UpdateContext, error) {
if f.Type != flow.TypeBrowser {
return nil, flow.ErrStrategyNotResponsible
return nil, errors.WithStack(flow.ErrStrategyNotResponsible)
}
var p updateSettingsFlowWithPasskeyMethod
ctxUpdate, err := settings.PrepareUpdate(s.d, w, r, f, ss, settings.ContinuityKey(s.SettingsStrategyID()), &p)
Expand Down

0 comments on commit 660f330

Please sign in to comment.