This pull request improves how image URLs are generated and handled throughout the frontend, ensuring that authentication is properly applied when fetching images. The main change is the addition of logic to prefer a session token (for authenticated users) when constructing image URLs, with a fallback to the API key for unauthenticated access. This update helps secure image access and supports user-specific sessions.
Image URL handling and authentication:
- Updated the
ApiService.getImageUrlmethod infe/src/services/api.tsto append a session token to image URLs if available, falling back to the API key if not. This applies to both library-detected and other relative image URLs, ensuring authenticated access where possible. - Refactored image rendering in
fe/src/App.vueandfe/src/components/AudiobookDetailsModal.vueto use the newapiService.getImageUrlmethod, ensuring that all image requests benefit from the improved authentication logic. [1] [2] - Imported
apiServiceintoAudiobookDetailsModal.vueto support the new usage of the image URL helper.Updated image URL generation to prefer session tokens for authenticated users, falling back to API key for non-authenticated access. Refactored image rendering in App.vue and AudiobookDetailsModal.vue to use the new apiService.getImageUrl method for consistent access control.
Automated canary build