Repository navigation
Implemented User GET, PATCH, DELETE API routes - #48
Conversation
| .orElseThrow(() -> new UsernameNotFoundException("No user named " + username)); | ||
| return org.springframework.security.core.userdetails.User | ||
| .withUsername(user.getDisplayName()) | ||
| .password(user.getEmail()) |
There was a problem hiding this comment.
just wondering why this password has user.getEmail() ?
There was a problem hiding this comment.
I actually don't really remember why I did that but users don't have a password in the db so I wasnt really sure what to put there
There was a problem hiding this comment.
actually I think it might supposed to be implemented differently since we will be using oauth, but im not sure what to do ATM cuz we dont have oauth set up yet...
There was a problem hiding this comment.
That makes sense. Since we're planning to use Google OAuth, we don't need to put anything in a local password field. The API should verify the Google token and use that identity to find the user in our database.
For now, we can keep using @WithMockUser to test the USER/ADMIN access rules without setting up a real password login. I'd remove the email-as-password implementation and coordinate the SecurityConfig changes with the OAuth work before merging. Those mock tests cover permissions, but we'll still need to test real authentication once OAuth is connected.
leslyVillanueva1020
left a comment
There was a problem hiding this comment.
Just had a quick comment on the UserService.java file just need some clarification on that. maybe i'm missunderstanding, but other than that looks good
|
Could we configure the 401/403 responses in Please add an It would also help to test unauthenticated requests and USER access to admin routes, checking the status, content type, and required body fields. This would also cover the meal plan routes in #45, so I’ll avoid duplicating the handling on my side. |
So sorry for the wait :(
Changes have been made, I think I made changes regarding everything you brought up but please let me know if there's anything I need to correct. |
leslyVillanueva1020
left a comment
There was a problem hiding this comment.
great thank you for correcting the comments 👍
Hopefully most problems are fixed
leslyVillanueva1020
left a comment
There was a problem hiding this comment.
looks good to me 👍
Closes #41
What changed
How I tested it
docs/openapi.yamlhas not been updatedReviewers
2 approving teammates who are not the author (1 for a team of 3).