summaryrefslogtreecommitdiffstats
path: root/modules/middleware/auth.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-11-18 11:07:16 -0500
committerUnknwon <joe2010xtmf@163.com>2014-11-18 11:07:16 -0500
commit37d8d3afe9ec589574c0cc6380a36fa93b1be8f2 (patch)
tree30d7751228cdded099b1a0e2952d66dbe6d403b6 /modules/middleware/auth.go
parentdb0026c5070f8e6b82170a75b5f92a54b7b96ff2 (diff)
downloadgitea-37d8d3afe9ec589574c0cc6380a36fa93b1be8f2.tar.gz
gitea-37d8d3afe9ec589574c0cc6380a36fa93b1be8f2.zip
more APIs on #12
Diffstat (limited to 'modules/middleware/auth.go')
-rw-r--r--modules/middleware/auth.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go
index 8388d2b25e..fc8e94bbd0 100644
--- a/modules/middleware/auth.go
+++ b/modules/middleware/auth.go
@@ -76,3 +76,12 @@ func ApiReqToken() macaron.Handler {
}
}
}
+
+func ApiReqBasicAuth() macaron.Handler {
+ return func(ctx *Context) {
+ if !ctx.IsBasicAuth {
+ ctx.Error(403)
+ return
+ }
+ }
+}