Login and register pages uses api functions, new styling and better handling in backend.
This commit is contained in:
13
middleware/mustBeAuthenticated.js
Normal file
13
middleware/mustBeAuthenticated.js
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
const mustBeAuthenticated = (req, res, next) => {
|
||||
if (!req.isAuthenticated()) {
|
||||
return res.status(401).send({
|
||||
success: false,
|
||||
message: "Du må være logget inn."
|
||||
})
|
||||
}
|
||||
|
||||
return next()
|
||||
}
|
||||
|
||||
module.exports = mustBeAuthenticated;
|
||||
Reference in New Issue
Block a user