From 5ecf5e823c6410766843e47c116a101c15df088d Mon Sep 17 00:00:00 2001 From: "Feng.YJ" <32027253+huiyifyj@users.noreply.github.com> Date: Wed, 25 Dec 2024 21:16:34 +0800 Subject: [PATCH] fix(webauthn): handle error when removing webauthn credential (#7689) --- server/handles/webauthn.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/handles/webauthn.go b/server/handles/webauthn.go index 1bd1884e..c6a7650c 100644 --- a/server/handles/webauthn.go +++ b/server/handles/webauthn.go @@ -207,6 +207,10 @@ func DeleteAuthnLogin(c *gin.Context) { return } err = db.RemoveAuthn(user, req.ID) + if err != nil { + common.ErrorResp(c, err, 400) + return + } err = op.DelUserCache(user.Username) if err != nil { common.ErrorResp(c, err, 400)