aboutsummaryrefslogtreecommitdiffstats
path: root/services/auth/group.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/auth/group.go')
-rw-r--r--services/auth/group.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/services/auth/group.go b/services/auth/group.go
index bbafe64b49..ef68fc35a6 100644
--- a/services/auth/group.go
+++ b/services/auth/group.go
@@ -10,7 +10,6 @@ import (
"reflect"
"strings"
- "code.gitea.io/gitea/models/db"
user_model "code.gitea.io/gitea/models/user"
)
@@ -81,23 +80,23 @@ func (b *Group) Free() error {
}
// Verify extracts and validates
-func (b *Group) Verify(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) *user_model.User {
- if !db.HasEngine {
- return nil
- }
-
+func (b *Group) Verify(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) (*user_model.User, error) {
// Try to sign in with each of the enabled plugins
for _, ssoMethod := range b.methods {
- user := ssoMethod.Verify(req, w, store, sess)
+ user, err := ssoMethod.Verify(req, w, store, sess)
+ if err != nil {
+ return nil, err
+ }
+
if user != nil {
if store.GetData()["AuthedMethod"] == nil {
if named, ok := ssoMethod.(Named); ok {
store.GetData()["AuthedMethod"] = named.Name()
}
}
- return user
+ return user, nil
}
}
- return nil
+ return nil, nil
}