mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(mobile): Add support for Basic Authentication (#6840)
This commit is contained in:
parent
b4c211cad1
commit
5061c35c8d
14 changed files with 33 additions and 33 deletions
|
|
@ -95,11 +95,11 @@ class ImmichImage extends StatelessWidget {
|
|||
},
|
||||
);
|
||||
}
|
||||
final String? token = Store.get(StoreKey.accessToken);
|
||||
final String? accessToken = Store.get(StoreKey.accessToken);
|
||||
final String thumbnailRequestUrl = getThumbnailUrl(asset, type: type);
|
||||
return CachedNetworkImage(
|
||||
imageUrl: thumbnailRequestUrl,
|
||||
httpHeaders: {"Authorization": "Bearer $token"},
|
||||
httpHeaders: {"x-immich-user-token": accessToken ?? ""},
|
||||
cacheKey: getThumbnailCacheKey(asset, type: type),
|
||||
width: width,
|
||||
height: height,
|
||||
|
|
@ -177,7 +177,7 @@ class ImmichImage extends StatelessWidget {
|
|||
getThumbnailUrlForRemoteId(assetId, type: type),
|
||||
cacheKey: getThumbnailCacheKeyForRemoteId(assetId, type: type),
|
||||
headers: {
|
||||
"Authorization": 'Bearer ${Store.get(StoreKey.accessToken)}',
|
||||
"x-immich-user-token": Store.get(StoreKey.accessToken),
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -195,10 +195,10 @@ class ImmichImage extends StatelessWidget {
|
|||
context,
|
||||
);
|
||||
} else {
|
||||
final authToken = 'Bearer ${Store.get(StoreKey.accessToken)}';
|
||||
final accessToken = Store.get(StoreKey.accessToken);
|
||||
// Precache the remote image since we are not using local images
|
||||
return precacheImage(
|
||||
remoteThumbnailProvider(asset, type, {"Authorization": authToken}),
|
||||
remoteThumbnailProvider(asset, type, {"x-immich-user-token": accessToken}),
|
||||
context,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue