mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 13:03:09 +08:00
fix(webauthn): enable discoverable keys (#2451)
Set `WithResidentKeyRequirement` option during registration to enable discoverable keys. Existing keys do not require migration. They won't appear without entering username, but work normally after username input, legacy flows remain unaffected.
This commit is contained in:
@@ -133,7 +133,10 @@ func BeginAuthnRegistration(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
options, sessionData, err := authnInstance.BeginRegistration(user)
|
||||
options, sessionData, err := authnInstance.BeginRegistration(
|
||||
user,
|
||||
webauthn.WithResidentKeyRequirement(protocol.ResidentKeyRequirementRequired),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
common.ErrorResp(c, err, 400)
|
||||
|
||||
Reference in New Issue
Block a user