mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-23 00:31:03 +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"
|
||
|
})
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
}
|