feat(api): attach session to request in requireAuth
- Add Express Request type augmentation for req.session - requireAuth now sets req.session after session validation, so protected handlers can read the user without calling getSession again - Add ConflictError (409) alongside existing AppError subclasses
This commit is contained in:
parent
cf56399a5e
commit
8c241636bf
3 changed files with 19 additions and 0 deletions
|
|
@ -16,5 +16,7 @@ export const requireAuth = async (
|
|||
return;
|
||||
}
|
||||
|
||||
req.session = session;
|
||||
|
||||
next();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue