diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-13 12:57:00 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-13 12:57:00 -0500 |
commit | 9dc3c93a6a1f0d604aa5e4408a4c43c29b963b0c (patch) | |
tree | 0d2113af522fa36d2c73760c3aace4088ee3ae78 /modules | |
parent | 9e2284048372864a7dbc5e192877ebdca04abcab (diff) | |
download | gitea-9dc3c93a6a1f0d604aa5e4408a4c43c29b963b0c.tar.gz gitea-9dc3c93a6a1f0d604aa5e4408a4c43c29b963b0c.zip |
#12, add/edit hook
Diffstat (limited to 'modules')
-rw-r--r-- | modules/base/base.go | 2 | ||||
-rw-r--r-- | modules/middleware/auth.go | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/modules/base/base.go b/modules/base/base.go index cb51478292..97c853c64d 100644 --- a/modules/base/base.go +++ b/modules/base/base.go @@ -9,7 +9,7 @@ type ( ApiJsonErr struct { Message string `json:"message"` - DocUrl string `json:"documentation_url"` + DocUrl string `json:"url"` } ) diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go index 2bc05697a9..8388d2b25e 100644 --- a/modules/middleware/auth.go +++ b/modules/middleware/auth.go @@ -67,3 +67,12 @@ func Toggle(options *ToggleOptions) macaron.Handler { } } } + +func ApiReqToken() macaron.Handler { + return func(ctx *Context) { + if !ctx.IsSigned { + ctx.Error(403) + return + } + } +} |