summaryrefslogtreecommitdiffstats
path: root/models/auth/webauthn.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/auth/webauthn.go')
-rw-r--r--models/auth/webauthn.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/auth/webauthn.go b/models/auth/webauthn.go
index d3062342f5..1575b6cbab 100644
--- a/models/auth/webauthn.go
+++ b/models/auth/webauthn.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/timeutil"
+ "code.gitea.io/gitea/modules/util"
"github.com/duo-labs/webauthn/webauthn"
"xorm.io/xorm"
@@ -29,6 +30,11 @@ func (err ErrWebAuthnCredentialNotExist) Error() string {
return fmt.Sprintf("WebAuthn credential does not exist [credential_id: %x]", err.CredentialID)
}
+// Unwrap unwraps this as a ErrNotExist err
+func (err ErrWebAuthnCredentialNotExist) Unwrap() error {
+ return util.ErrNotExist
+}
+
// IsErrWebAuthnCredentialNotExist checks if an error is a ErrWebAuthnCredentialNotExist.
func IsErrWebAuthnCredentialNotExist(err error) bool {
_, ok := err.(ErrWebAuthnCredentialNotExist)