Skip to content

Add me endpoint#21

Merged
NourAlPha merged 2 commits intodevfrom
add-me
May 4, 2025
Merged

Add me endpoint#21
NourAlPha merged 2 commits intodevfrom
add-me

Conversation

@NourAlPha
Copy link
Copy Markdown
Contributor

Add endpoint to fetch current user details; implement getCurrentUserDetails method in AuthenticationService

@NourAlPha NourAlPha requested review from a team and Copilot May 4, 2025 20:08
Copy link
Copy Markdown
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 introduces a new endpoint to fetch current user details and implements the corresponding business logic in the AuthenticationService.

  • Added the getCurrentUserDetails method to return details of the authenticated user or throw an exception if not properly authenticated.
  • Introduced a new /me endpoint in the AuthenticationController to expose the new functionality.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/main/java/com/podzilla/auth/service/AuthenticationService.java Added getCurrentUserDetails method and a helper method for ensuring correct authentication type.
src/main/java/com/podzilla/auth/controller/AuthenticationController.java Added a new GET endpoint (/me) to retrieve current user details.
Comments suppressed due to low confidence (1)

src/main/java/com/podzilla/auth/service/AuthenticationService.java:167

  • [nitpick] The method name 'checkUserNotLoggedIn' is ambiguous given its purpose of ensuring the user is actually logged in. Consider renaming it to 'checkUserLoggedIn' for clearer intent.
private void checkUserNotLoggedIn(final String message) {

@NourAlPha NourAlPha changed the title Add endpoint to fetch current user details; implement getCurrentUserD… Add me endpoint May 4, 2025
@NourAlPha NourAlPha merged commit b845789 into dev May 4, 2025
5 checks passed
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