diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-09-20 11:19:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 11:19:02 +0800 |
commit | 3af91d7cfdb334e602d312743a89e64cd2d369ee (patch) | |
tree | c04a148917cdd9be878ca0e5fbcd552825c18df7 /internal/route/org/setting.go | |
parent | b836a56e6e823eecbce2dd99121a340418f1d5b7 (diff) |
auth: decouple types and functions from db (#6320)
Diffstat (limited to 'internal/route/org/setting.go')
-rw-r--r-- | internal/route/org/setting.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/route/org/setting.go b/internal/route/org/setting.go index e3b2bf3c..94e9b7a6 100644 --- a/internal/route/org/setting.go +++ b/internal/route/org/setting.go @@ -9,6 +9,7 @@ import ( log "unknwon.dev/clog/v2" + "gogs.io/gogs/internal/auth" "gogs.io/gogs/internal/conf" "gogs.io/gogs/internal/context" "gogs.io/gogs/internal/db" @@ -109,7 +110,7 @@ func SettingsDelete(c *context.Context) { org := c.Org.Organization if c.Req.Method == "POST" { if _, err := db.Users.Authenticate(c.User.Name, c.Query("password"), c.User.LoginSource); err != nil { - if db.IsErrUserNotExist(err) { + if auth.IsErrBadCredentials(err) { c.RenderWithErr(c.Tr("form.enterred_invalid_password"), SETTINGS_DELETE, nil) } else { c.Error(err, "authenticate user") |