diff options
Diffstat (limited to 'routers/api/v1/admin/user.go')
-rw-r--r-- | routers/api/v1/admin/user.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index 5d2bbdea2f..e95ab33d77 100644 --- a/routers/api/v1/admin/user.go +++ b/routers/api/v1/admin/user.go @@ -13,8 +13,8 @@ import ( "code.gitea.io/gitea/models" asymkey_model "code.gitea.io/gitea/models/asymkey" + "code.gitea.io/gitea/models/auth" "code.gitea.io/gitea/models/db" - "code.gitea.io/gitea/models/login" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" @@ -30,17 +30,17 @@ import ( user_service "code.gitea.io/gitea/services/user" ) -func parseLoginSource(ctx *context.APIContext, u *user_model.User, sourceID int64, loginName string) { +func parseAuthSource(ctx *context.APIContext, u *user_model.User, sourceID int64, loginName string) { if sourceID == 0 { return } - source, err := login.GetSourceByID(sourceID) + source, err := auth.GetSourceByID(sourceID) if err != nil { - if login.IsErrSourceNotExist(err) { + if auth.IsErrSourceNotExist(err) { ctx.Error(http.StatusUnprocessableEntity, "", err) } else { - ctx.Error(http.StatusInternalServerError, "login.GetSourceByID", err) + ctx.Error(http.StatusInternalServerError, "auth.GetSourceByID", err) } return } @@ -82,13 +82,13 @@ func CreateUser(ctx *context.APIContext) { Passwd: form.Password, MustChangePassword: true, IsActive: true, - LoginType: login.Plain, + LoginType: auth.Plain, } if form.MustChangePassword != nil { u.MustChangePassword = *form.MustChangePassword } - parseLoginSource(ctx, u, form.SourceID, form.LoginName) + parseAuthSource(ctx, u, form.SourceID, form.LoginName) if ctx.Written() { return } @@ -168,7 +168,7 @@ func EditUser(ctx *context.APIContext) { return } - parseLoginSource(ctx, u, form.SourceID, form.LoginName) + parseAuthSource(ctx, u, form.SourceID, form.LoginName) if ctx.Written() { return } |