diff options
author | Morgan Bazalgette <git@howl.moe> | 2018-01-10 22:34:17 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-01-10 23:34:17 +0200 |
commit | 65861900cda3bb6d9e2aa80b808b0000383c04b3 (patch) | |
tree | 8569d93b6ef092b30b35a4d4da906c6b6950e2ee /routers/user/auth_openid.go | |
parent | 45c264f681e3f7e1a22a191029836a690959aac3 (diff) | |
download | gitea-65861900cda3bb6d9e2aa80b808b0000383c04b3.tar.gz gitea-65861900cda3bb6d9e2aa80b808b0000383c04b3.zip |
Handle refactor (#3339)
* Replace all ctx.Handle with ctx.ServerError or ctx.NotFound
* Change Handle(403) to NotFound, avoid using macaron's NotFound
Diffstat (limited to 'routers/user/auth_openid.go')
-rw-r--r-- | routers/user/auth_openid.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/user/auth_openid.go b/routers/user/auth_openid.go index a5124680dd..c784d7e1e2 100644 --- a/routers/user/auth_openid.go +++ b/routers/user/auth_openid.go @@ -37,7 +37,7 @@ func SignInOpenID(ctx *context.Context) { // Check auto-login. isSucceed, err := AutoSignIn(ctx) if err != nil { - ctx.Handle(500, "AutoSignIn", err) + ctx.ServerError("AutoSignIn", err) return } @@ -276,7 +276,7 @@ func ConnectOpenIDPost(ctx *context.Context, form auth.ConnectOpenIDForm) { if models.IsErrUserNotExist(err) { ctx.RenderWithErr(ctx.Tr("form.username_password_incorrect"), tplConnectOID, &form) } else { - ctx.Handle(500, "ConnectOpenIDPost", err) + ctx.ServerError("ConnectOpenIDPost", err) } return } @@ -288,7 +288,7 @@ func ConnectOpenIDPost(ctx *context.Context, form auth.ConnectOpenIDForm) { ctx.RenderWithErr(ctx.Tr("form.openid_been_used", oid), tplConnectOID, &form) return } - ctx.Handle(500, "AddUserOpenID", err) + ctx.ServerError("AddUserOpenID", err) return } @@ -376,7 +376,7 @@ func RegisterOpenIDPost(ctx *context.Context, cpt *captcha.Captcha, form auth.Si ctx.Data["Err_UserName"] = true ctx.RenderWithErr(ctx.Tr("user.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), tplSignUpOID, &form) default: - ctx.Handle(500, "CreateUser", err) + ctx.ServerError("CreateUser", err) } return } @@ -389,7 +389,7 @@ func RegisterOpenIDPost(ctx *context.Context, cpt *captcha.Captcha, form auth.Si ctx.RenderWithErr(ctx.Tr("form.openid_been_used", oid), tplSignUpOID, &form) return } - ctx.Handle(500, "AddUserOpenID", err) + ctx.ServerError("AddUserOpenID", err) return } @@ -399,7 +399,7 @@ func RegisterOpenIDPost(ctx *context.Context, cpt *captcha.Captcha, form auth.Si u.IsActive = true u.SetLastLogin() if err := models.UpdateUserCols(u, "is_admin", "is_active", "last_login_unix"); err != nil { - ctx.Handle(500, "UpdateUser", err) + ctx.ServerError("UpdateUser", err) return } } |