repo.or.cz
/
gitter.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'hotfix/21.56.9' into master
[gitter.git]
/
server
/
web
/
middlewares
/
ensure-logged-in-or-get.js
blob
39c6f681a5c97a3ff6ec0339204a5139137fc781
1
'use strict'
;
2
3
var
loginRequired
=
require
(
'./login-required'
);
4
5
module
.
exports
=
function
(
req
,
res
,
next
) {
6
if
(
req
.
user
) {
7
return
next
();
8
}
9
10
if
(
req
.
method
===
'GET'
) {
11
return
next
();
12
}
13
14
loginRequired
(
req
,
res
,
next
);
15
};