Closed atkaksoy501 closed 7 months ago
This update introduces CustomUserDetails
, enhancing user authentication by including additional user information such as name and ID in the system. It modifies various components to use CustomUserDetails
over UserDetails
, adjusts JWT token generation to embed these new details, and shortens cookie expiration for improved security.
File Path | Change Summary |
---|---|
.../api/controllers/AuthsController.java |
- Import and use CustomUserDetails - Update cookie expiration from 7 days to 1 day |
.../security/CustomUserDetails.java |
- New file defining CustomUserDetails interface extending UserDetails |
.../security/JpaUserDetailsService.java |
- Change loadUserByUsername return type to CustomUserDetails |
.../security/UserSecurity.java |
- Implements CustomUserDetails - Adds getName() and getId() |
.../security/config/JwtUtils.java |
- Use CustomUserDetails for token generation- Add claims for email, name, and id |
In the digital realm, where security is key,
A rabbit hopped in, with changes to see.
🐰 "Let's make authentication clear and bright,
With names and IDs in tokens, just right."
Now, cookies expire quicker, for safety's delight,
And JWTs gleam with user info, shining light.
"With every hop and code commit, let's aim for the peak,
Ensuring our digital world is secure, never bleak."
Summary by CodeRabbit