summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-06-21 00:53:46 -0400
committerUnknown <joe2010xtmf@163.com>2014-06-21 00:53:46 -0400
commit9d2cef23f2af273933da8f1cef150c1d163be5ee (patch)
tree0bf5cb25485b29407b93655ef00e4313efcc7276 /modules
parentad5ec45dd63aa2563d113e6a9ce31180246aa5f2 (diff)
downloadgitea-9d2cef23f2af273933da8f1cef150c1d163be5ee.tar.gz
gitea-9d2cef23f2af273933da8f1cef150c1d163be5ee.zip
Fix #165
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/user.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/auth/user.go b/modules/auth/user.go
index fdbba31af5..284a4644de 100644
--- a/modules/auth/user.go
+++ b/modules/auth/user.go
@@ -25,7 +25,11 @@ func SignedInId(header http.Header, sess session.SessionStore) int64 {
return 0
}
- id, _ := base.StrTo(header.Get(setting.ReverseProxyAuthUid)).Int64()
+ var id int64
+ if setting.Service.EnableReverseProxyAuth {
+ id, _ = base.StrTo(header.Get(setting.ReverseProxyAuthUid)).Int64()
+ }
+
if id <= 0 {
uid := sess.Get("userId")
if uid == nil {