Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

feat: add session management with user profile retrieval and update s… - #17

Merged
danielvanginneken merged 4 commits into
mainfrom
Sari
Dec 16, 2025
Merged

danielvanginneken merged 4 commits into
mainfrom
Sari

Conversation

@AlirizaSari

Copy link
Copy Markdown
Contributor

This pull request introduces several important improvements related to session management and user authentication. It updates session configuration for better user experience and security, adds new dependencies to support validation and session handling, and implements a new endpoint to retrieve the authenticated user's profile.

Session Management and Security Improvements:

  • The session cookie's maxAge has been increased from 1 hour to 24 hours to keep users logged in longer. The rolling option is now enabled to refresh the session expiration on each request, and resave is set to true to ensure sessions are always saved, even if unmodified.

Dependency Additions:

  • Added class-transformer, class-validator, and express-session to package.json to support DTO validation and session management.

User Authentication Endpoint:

  • Implemented a new GET /user/profile endpoint in UserController that returns the currently authenticated user's profile from the session. If there is no active session, it throws an UnauthorizedException.

@danielvanginneken danielvanginneken left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, why not get the user from the database in profile endpoint? i know getting user from session works but database is more up to date!

@danielvanginneken
danielvanginneken merged commit 0e34158 into main Dec 16, 2025
1 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Als gebruiker wil ik mijn profiel kunnen bekijken en wijzigen zodat mijn voorkeuren up-to-date blijven.

2 participants