Skip to content

Conversation

@EmielBoss
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings November 17, 2025 21:07
@github-actions
Copy link

github-actions bot commented Nov 17, 2025

Test Results

14 tests  +9   14 ✅ +9   4s ⏱️ -1s
 4 suites +1    0 💤 ±0 
 4 files   +1    0 ❌ ±0 

Results for commit a81faf8. ± Comparison against base commit 2b9f39b.

♻️ This comment has been updated with latest results.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds functionality for users to update their email address and password through the profile view. The changes include new backend API endpoints, service methods, and a redesigned frontend profile interface with collapsible forms for updating credentials.

Key Changes:

  • Added UserService with methods to get/update email and password
  • Created new REST endpoints in UserResource for email and password updates
  • Implemented UI forms in ProfileView.vue with validation and loading states
  • Refactored UserLoginException to UserAuthenticationException for broader authentication error handling

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
app/src/main/java/dev/blaauwendraad/recipe_book/service/UserService.java New service class with email/password update logic and user authentication
app/src/main/java/dev/blaauwendraad/recipe_book/web/UserResource.java New REST resource providing endpoints for email/password operations with authorization checks
app/src/main/java/dev/blaauwendraad/recipe_book/web/model/UpdateEmailRequest.java Request DTO for email updates with validation annotations
app/src/main/java/dev/blaauwendraad/recipe_book/web/model/UpdatePasswordRequest.java Request DTO for password updates with validation annotations
app/src/main/java/dev/blaauwendraad/recipe_book/service/exception/UserAuthenticationException.java Renamed exception class (formerly UserLoginException) for authentication errors
app/src/main/java/dev/blaauwendraad/recipe_book/service/exception/UserAuthenticationExceptionMapper.java Updated mapper to handle renamed exception with improved error message
app/src/main/java/dev/blaauwendraad/recipe_book/service/UserAuthenticationService.java Updated to throw renamed UserAuthenticationException
app/src/main/java/dev/blaauwendraad/recipe_book/web/UserAuthenticationResource.java Updated login endpoint to throw renamed UserAuthenticationException
app/src/test/java/dev/blaauwendraad/recipe_book/service/UserAuthenticationTest.java Updated test to reference renamed UserAuthenticationException
app/src/main/java/dev/blaauwendraad/recipe_book/web/model/SaveRecipeRequestDto.java Removed duplicate @NotNull annotation from numServings field
ui/src/api/userApi.ts New API client functions for email/password operations with error handling
ui/src/components/ProfileView.vue Enhanced profile view with collapsible email/password update forms including validation and feedback

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@EmielBoss EmielBoss force-pushed the email-and-password-updating branch 3 times, most recently from 24b1a89 to 26a8027 Compare November 23, 2025 16:00
@EmielBoss EmielBoss force-pushed the email-and-password-updating branch from 26a8027 to f7c6b5b Compare November 23, 2025 16:35
Comment on lines +9 to +12
} catch (error) {
console.error("Error fetching user: ", error);
throw error;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Why does this not have the if (error instanceof HttpError) like the ones below?

Comment on lines 12 to 17
export const updateEmail = async (userId: number, newEmail: string, currentPassword: string): Promise<void> => {
try {
return await put(`/users/${userId}/email`, { newEmail, currentPassword }, {auth: "accessToken"});
} catch (error) {
if(error instanceof HttpError) {
throw new Error(error.data.detail);
Copy link
Owner

Choose a reason for hiding this comment

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

Why are all these functions duplicated in both userAccountApi and userApi??

@EmielBoss EmielBoss force-pushed the email-and-password-updating branch from 2dd97f4 to a81faf8 Compare January 4, 2026 21:07
@EmielBoss EmielBoss merged commit 27c41a8 into master Jan 6, 2026
2 checks passed
@EmielBoss EmielBoss deleted the email-and-password-updating branch January 6, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants