diff options
Diffstat (limited to 'modules/context/auth.go')
-rw-r--r-- | modules/context/auth.go | 4 |
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 } |