mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-27 02:52:14 +01:00
17 lines
256 B
JavaScript
17 lines
256 B
JavaScript
exports.authorized = function (req, res, next) {
|
|
if (res.locals.loggedIn) {
|
|
next()
|
|
} else {
|
|
res.format({
|
|
html: function() {
|
|
res.render('auth');
|
|
},
|
|
json: function() {
|
|
res.send(403, {
|
|
message: "Unauthorized"
|
|
})
|
|
}
|
|
})
|
|
}
|
|
}
|