summaryrefslogtreecommitdiffstats
path: root/models/user/openid.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user/openid.go')
-rw-r--r--models/user/openid.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/user/openid.go b/models/user/openid.go
index 8ef0ce5ed7..f8e8a787e6 100644
--- a/models/user/openid.go
+++ b/models/user/openid.go
@@ -10,6 +10,7 @@ import (
"fmt"
"code.gitea.io/gitea/models/db"
+ "code.gitea.io/gitea/modules/util"
)
// ErrOpenIDNotExist openid is not known
@@ -65,6 +66,10 @@ func (err ErrOpenIDAlreadyUsed) Error() string {
return fmt.Sprintf("OpenID already in use [oid: %s]", err.OpenID)
}
+func (err ErrOpenIDAlreadyUsed) Unwrap() error {
+ return util.ErrAlreadyExist
+}
+
// AddUserOpenID adds an pre-verified/normalized OpenID URI to given user.
// NOTE: make sure openid.URI is normalized already
func AddUserOpenID(ctx context.Context, openid *UserOpenID) error {