Fix ssr issue with jwts

This commit is contained in:
Zoe Roux 2023-12-03 18:32:52 +01:00
parent 4f7c449ea7
commit f9a2185748

View File

@ -71,10 +71,11 @@ export const getTokenWJ = async (
{ {
path: ["auth", "refresh", `?token=${account.token.refresh_token}`], path: ["auth", "refresh", `?token=${account.token.refresh_token}`],
method: "GET", method: "GET",
authenticated: false,
}, },
TokenP, TokenP,
); );
updateAccount(account.id, { ...account, token }); if (typeof window !== "undefined") updateAccount(account.id, { ...account, token });
} catch (e) { } catch (e) {
console.error("Error refreshing token durring ssr:", e); console.error("Error refreshing token durring ssr:", e);
} }