Enforce token on api routes [fixed critical security issue #4357] (#4840)

This commit is contained in:
B-OnTheGo authored and techknowlogick committed 2018-09-10 12:15:52 -04:00
1 parent 387a4b09c1
commit e47df0b301
17 files changed
+131 -89

No files matched your search

+2 -1
View File
@@ -63,6 +63,7 @@ func SignedInID(ctx *macaron.Context, sess session.Store) int64 {
if err = models.UpdateAccessToken(t); err != nil {
log.Error(4, "UpdateAccessToken: %v", err)
}
ctx.Data["IsApiToken"] = true
return t.UID
}
}
@@ -136,7 +137,7 @@ func SignedInUser(ctx *macaron.Context, sess session.Store) (*models.User, bool)
}
return nil, false
}
ctx.Data["IsApiToken"] = true
return u, true
}
}