aboutsummaryrefslogtreecommitdiffstats
path: root/models/auth/twofactor.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/auth/twofactor.go')
-rw-r--r--models/auth/twofactor.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/auth/twofactor.go b/models/auth/twofactor.go
index c5bd972f91..736d4c340c 100644
--- a/models/auth/twofactor.go
+++ b/models/auth/twofactor.go
@@ -41,6 +41,11 @@ func (err ErrTwoFactorNotEnrolled) Error() string {
return fmt.Sprintf("user not enrolled in 2FA [uid: %d]", err.UID)
}
+// Unwrap unwraps this as a ErrNotExist err
+func (err ErrTwoFactorNotEnrolled) Unwrap() error {
+ return util.ErrNotExist
+}
+
// TwoFactor represents a two-factor authentication token.
type TwoFactor struct {
ID int64 `xorm:"pk autoincr"`