repo.or.cz
/
gitter.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Gitter migration: Setup redirects (rollout pt. 3)
[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
};