summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
authorB-OnTheGo <42626718+beeonthego@users.noreply.github.com>2018-09-11 02:15:52 +1000
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-09-10 12:15:52 -0400
commite47df0b301510a49b49fc43266f436b7d58a02b1 (patch)
treeacc014c8e82a3b75754c9969f078b25579a523e9 /routers/api/v1/api.go
parent387a4b09c1b62a2a5eb70b89559d5ae53032c989 (diff)
downloadgitea-e47df0b301510a49b49fc43266f436b7d58a02b1.tar.gz
gitea-e47df0b301510a49b49fc43266f436b7d58a02b1.zip
Enforce token on api routes [fixed critical security issue #4357] (#4840)
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 967db3b01c..23a85759c2 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -175,7 +175,7 @@ func repoAssignment() macaron.Handler {
// Contexter middleware already checks token for user sign in process.
func reqToken() macaron.Handler {
return func(ctx *context.Context) {
- if !ctx.IsSigned {
+ if true != ctx.Data["IsApiToken"] {
ctx.Error(401)
return
}