summaryrefslogtreecommitdiffstats
path: root/modules/context/auth.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-13 18:49:16 -0400
committerUnknwon <u@gogs.io>2016-03-13 18:49:16 -0400
commitdd6faf7f9bd0a1dbf986e124ea0f4db249e1da48 (patch)
tree7f9e4107eb961712a56160ef544143eee3771653 /modules/context/auth.go
parentdb4da7beecd6a8f65bfa264ba18a8cb12303921f (diff)
downloadgitea-dd6faf7f9bd0a1dbf986e124ea0f4db249e1da48.tar.gz
gitea-dd6faf7f9bd0a1dbf986e124ea0f4db249e1da48.zip
Convert all API handers to use *context.APIContext
Diffstat (limited to 'modules/context/auth.go')
-rw-r--r--modules/context/auth.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/context/auth.go b/modules/context/auth.go
index 41c8b9eb01..422869db2d 100644
--- a/modules/context/auth.go
+++ b/modules/context/auth.go
@@ -52,7 +52,9 @@ func Toggle(options *ToggleOptions) macaron.Handler {
if !ctx.IsSigned {
// Restrict API calls with error message.
if auth.IsAPIPath(ctx.Req.URL.Path) {
- ctx.APIError(403, "", "Only signed in user is allowed to call APIs.")
+ ctx.JSON(403, map[string]string{
+ "message": "Only signed in user is allowed to call APIs.",
+ })
return
}