diff --git a/front/packages/models/src/login.ts b/front/packages/models/src/login.ts index 9b910179..e9799a12 100644 --- a/front/packages/models/src/login.ts +++ b/front/packages/models/src/login.ts @@ -138,6 +138,11 @@ export const getTokenWJ = async ( export const getToken = async (): Promise => (await getTokenWJ())[0]; +export const getCurrentToken = () => { + const account = getCurrentAccount(); + return account ? `${account.token.token_type} ${account.token.access_token}` : null; +}; + export const useToken = () => { const account = getCurrentAccount(); const refresher = useRef(null); diff --git a/front/packages/primitives/src/image/image.tsx b/front/packages/primitives/src/image/image.tsx index 5c0c60d5..667b9de0 100644 --- a/front/packages/primitives/src/image/image.tsx +++ b/front/packages/primitives/src/image/image.tsx @@ -25,6 +25,7 @@ import { Blurhash } from "react-native-blurhash"; import { percent, useYoshiki } from "yoshiki/native"; import { Props, ImageLayout } from "./base-image"; import { Skeleton } from "../skeleton"; +import { getCurrentToken } from "@kyoo/models"; export const Image = ({ src, @@ -60,6 +61,7 @@ export const Image = ({ } quality ??= "high"; + const token = getCurrentToken(); return ( {state !== "finished" && ( @@ -72,6 +74,11 @@ export const Image = ({