Multiple changes, basic rental CRUD backend implemented.
All responses are now in their own object with context name. Added limit to user based recent results for matches. Moved all code in endpoints inside try and catch. Renamed authentication guard function.
This commit is contained in:
@@ -17,7 +17,7 @@ if (process.env.NODE_ENV === "production") {
|
||||
}
|
||||
export const userSession = session(sessionConf);
|
||||
|
||||
export async function authenticationGuard(req, res, next) {
|
||||
export async function requireAuthenticated(req, res, next) {
|
||||
if (req.session.userId) {
|
||||
req.user = await userModel.findById(req.session.userId);
|
||||
next();
|
||||
@@ -26,7 +26,3 @@ export async function authenticationGuard(req, res, next) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Authentication
|
||||
// TODO: Identity
|
||||
// TODO: Authority
|
Reference in New Issue
Block a user