auth: support authentication source config file (#3142)

This commit is contained in:
Unknwon
2018-04-12 09:55:58 -04:00
parent 717d409b72
commit f2ecfdc96a
24 changed files with 504 additions and 166 deletions

View File

@@ -10,6 +10,7 @@ import (
api "github.com/gogits/go-gogs-client"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/models/errors"
"github.com/gogits/gogs/pkg/context"
"github.com/gogits/gogs/pkg/mailer"
"github.com/gogits/gogs/pkg/setting"
@@ -23,7 +24,7 @@ func parseLoginSource(c *context.APIContext, u *models.User, sourceID int64, log
source, err := models.GetLoginSourceByID(sourceID)
if err != nil {
if models.IsErrLoginSourceNotExist(err) {
if errors.IsLoginSourceNotExist(err) {
c.Error(422, "", err)
} else {
c.Error(500, "GetLoginSourceByID", err)