mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-12-04 07:11:05 +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"
|
|
})
|
|
}
|
|
})
|
|
}
|
|
}
|