summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-10-07 19:17:27 +0200
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-12-02 09:18:15 +0100
commite6cfccdd40397b95dcf3de0ea9b484feea954fc2 (patch)
tree8c758b622b022ffae542bf4caf3eb9c8623bd317 /modules
parent71bb6df75ae541687c64f5e6e4da16ea9e95acfe (diff)
downloadgitea-e6cfccdd40397b95dcf3de0ea9b484feea954fc2.tar.gz
gitea-e6cfccdd40397b95dcf3de0ea9b484feea954fc2.zip
GitHub API Compliance (& linting)
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/auth.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go
index ed94d0a698..811f890746 100644
--- a/modules/auth/auth.go
+++ b/modules/auth/auth.go
@@ -35,6 +35,9 @@ func SignedInID(ctx *macaron.Context, sess session.Store) int64 {
// Check access token.
if IsAPIPath(ctx.Req.URL.Path) {
tokenSHA := ctx.Query("token")
+ if len(tokenSHA) <= 0 {
+ tokenSHA = ctx.Query("access_token")
+ }
if len(tokenSHA) == 0 {
// Well, check with header again.
auHead := ctx.Req.Header.Get("Authorization")