Conversation
* Introduced UserPhotoVoter for managing photo upload and delete permissions. * Updated ApiController to use voter for access control instead of ROLE_ADMIN. * Enhanced security by allowing users to manage their own photos.
* Changed subject type handling from UserPhoto to string. * Updated methods to accept string identifiers for user photo operations. * Ensured compatibility with user identifier checks.
* Introduced username state to track logged-in user's name. * Updated localStorage handling for username during login and logout. * Enhanced auth state returned by useAuth to include username.
* Added `isOwnProfile` prop to UserCard for user-specific actions * Updated UserGrid to pass logged-in username for profile checks * Modified UserCard to enable edit/delete buttons for own photos
* Set token time-to-live to 1200 seconds (20 minutes)
* Implemented AbortController to manage fetch request cancellation. * Prevented state updates on unmounted components by aborting fetch.
* Add logout handling for 401 responses when saving or deleting photos. * Notify users to reconnect upon session expiration.
* Clear selected file and local preview URL upon save * Ensure handleSavePhoto returns false if token is missing
Cold-FR
added a commit
that referenced
this pull request
Mar 16, 2026
* feat(api): implement user photo upload and delete permissions * Introduced UserPhotoVoter for managing photo upload and delete permissions. * Updated ApiController to use voter for access control instead of ROLE_ADMIN. * Enhanced security by allowing users to manage their own photos. * refactor(api): update UserPhotoVoter to use string identifiers * Changed subject type handling from UserPhoto to string. * Updated methods to accept string identifiers for user photo operations. * Ensured compatibility with user identifier checks. * feat(auth): add username state management in useAuth * Introduced username state to track logged-in user's name. * Updated localStorage handling for username during login and logout. * Enhanced auth state returned by useAuth to include username. * feat(ui): allow users to edit and delete their own photos * Added `isOwnProfile` prop to UserCard for user-specific actions * Updated UserGrid to pass logged-in username for profile checks * Modified UserCard to enable edit/delete buttons for own photos * feat(config): add token TTL to JWT authentication settings * Set token time-to-live to 1200 seconds (20 minutes) * feat(api): add abort signal to user fetch request * Implemented AbortController to manage fetch request cancellation. * Prevented state updates on unmounted components by aborting fetch. * feat(ui): handle session expiration on photo actions * Add logout handling for 401 responses when saving or deleting photos. * Notify users to reconnect upon session expiration. * feat(ui): reset photo upload state after saving * Clear selected file and local preview URL upon save * Ensure handleSavePhoto returns false if token is missing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.