Skip to content

Commit cc49208

Browse files
committed
refactor(components): Exclude Auth Token for External Avatar Images
This patch focuses on resolving issues encountered with avatar image loading, specifically addressing the challenges related to CORS (Cross-Origin Resource Sharing) errors. Changes: - Removed the `isAuthTokenRequired` flag from the `AttachmentModal` component in various files, including `ProfilePage.js`, `RoomHeaderAvatars.js`, and `DetailsPage.js`. This change is crucial for loading of avatar images that are hosted externally. Rationale: - The primary purpose of this modification is to streamline the loading process for avatars by removing the unnecessary inclusion of authentication tokens in requests for external images. This approach aligns with standard practices for handling externally hosted content and aims to enhance compatibility and performance. - Raised a question here as whether there are cases of avatar images that need authentication: https://github.com/Expensify/App/pull/24425/files#r1404352872 This update is expected to resolve the CORS errors associated with avatar image loading, thereby improving the overall functionality and user experience in our application.
1 parent 19b605e commit cc49208

File tree

3 files changed

+0
-4
lines changed

3 files changed

+0
-4
lines changed

src/components/RoomHeaderAvatars.js

-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ function RoomHeaderAvatars(props) {
3333
<AttachmentModal
3434
headerTitle={props.icons[0].name}
3535
source={UserUtils.getFullSizeAvatar(props.icons[0].source, props.icons[0].id)}
36-
isAuthTokenRequired
3736
isWorkspaceAvatar={props.icons[0].type === CONST.ICON_TYPE_WORKSPACE}
3837
originalFileName={props.icons[0].name}
3938
>
@@ -78,7 +77,6 @@ function RoomHeaderAvatars(props) {
7877
<AttachmentModal
7978
headerTitle={icon.name}
8079
source={UserUtils.getFullSizeAvatar(icon.source, icon.id)}
81-
isAuthTokenRequired
8280
originalFileName={icon.name}
8381
isWorkspaceAvatar={icon.type === CONST.ICON_TYPE_WORKSPACE}
8482
>

src/pages/DetailsPage.js

-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ function DetailsPage(props) {
134134
<AttachmentModal
135135
headerTitle={details.displayName}
136136
source={UserUtils.getFullSizeAvatar(details.avatar, details.accountID)}
137-
isAuthTokenRequired
138137
originalFileName={details.originalFileName}
139138
>
140139
{({show}) => (

src/pages/ProfilePage.js

-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ function ProfilePage(props) {
159159
<AttachmentModal
160160
headerTitle={displayName}
161161
source={UserUtils.getFullSizeAvatar(avatar, accountID)}
162-
isAuthTokenRequired
163162
originalFileName={originalFileName}
164163
fallbackSource={fallbackIcon}
165164
>

0 commit comments

Comments
 (0)