summaryrefslogtreecommitdiffstats
path: root/modules/middleware/auth.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-10-08 20:36:07 -0400
committerUnknwon <u@gogs.io>2015-10-08 20:36:07 -0400
commitaff49b1c9eaa33f7c530275f2695d6d96699ec5d (patch)
treec3720601db2e005e57032feb42deac7e347ac713 /modules/middleware/auth.go
parentb1941f1da18b8c6ca046771c21f21ba793765518 (diff)
downloadgitea-aff49b1c9eaa33f7c530275f2695d6d96699ec5d.tar.gz
gitea-aff49b1c9eaa33f7c530275f2695d6d96699ec5d.zip
unified API error response
Diffstat (limited to 'modules/middleware/auth.go')
-rw-r--r--modules/middleware/auth.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go
index 4f92c8f8e3..be8db35733 100644
--- a/modules/middleware/auth.go
+++ b/modules/middleware/auth.go
@@ -95,7 +95,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
if !ctx.IsSigned {
// Restrict API calls with error message.
if auth.IsAPIPath(ctx.Req.URL.Path) {
- ctx.HandleAPI(403, "Only signed in user is allowed to call APIs.")
+ ctx.APIError(403, "", "Only signed in user is allowed to call APIs.")
return
}