Skip to content

Feature/handle own photo#24

Merged
Cold-FR merged 8 commits intomainfrom
feature/handle-own-photo
Mar 12, 2026
Merged

Feature/handle own photo#24
Cold-FR merged 8 commits intomainfrom
feature/handle-own-photo

Conversation

@Cold-FR
Copy link
Owner

@Cold-FR Cold-FR commented Mar 12, 2026

No description provided.

Cold-FR added 8 commits March 12, 2026 09:01
* 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 Cold-FR self-assigned this Mar 12, 2026
@Cold-FR Cold-FR added the enhancement New feature or request label Mar 12, 2026
@Cold-FR Cold-FR merged commit a3f85d6 into main Mar 12, 2026
2 checks passed
@Cold-FR Cold-FR deleted the feature/handle-own-photo branch March 12, 2026 09:26
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant