Cookies v SSR

This commit is contained in:
Michal Kváček
2023-12-10 22:10:26 +01:00
parent 71389caecc
commit 9b38abd0de
10 changed files with 173 additions and 155 deletions
+2
View File
@@ -10,6 +10,7 @@ import {createUploadLink} from "apollo-upload-client";
const handleRefreshToken = (store, router, forward, operation) => {
if (!operation.query?._refreshUnauthorizedUser) return;
console.log("refreshing token, ", operation.query);
return fromPromise(useUserStore(store).refreshAccessToken()
.catch((error) => {
Notify.create(warningObject("Tvoje přihlášení vypřešlo. Přihlaš se prosím znovu."));
@@ -34,6 +35,7 @@ export const apolloWrapper = {};
export default (({store, router}) => {
const uploadLink = createUploadLink({
uri: process.env.API_URL + '/graphql',
credentials: 'include'
})
const authLink = new ApolloLink((operation, forward) => {