|
@@ -1,13 +1,16 @@
|
|
|
import {PUBLIC_API_URL} from "$env/static/public";
|
|
import {PUBLIC_API_URL} from "$env/static/public";
|
|
|
import {error} from "@sveltejs/kit";
|
|
import {error} from "@sveltejs/kit";
|
|
|
|
|
|
|
|
-export async function load({fetch, params}){
|
|
|
|
|
|
|
+export async function load({fetch, params, cookies}){
|
|
|
const {game_id} = params;
|
|
const {game_id} = params;
|
|
|
|
|
+ const userCookie = cookies.get("user");
|
|
|
|
|
|
|
|
const response = await fetch(`${PUBLIC_API_URL}/game/${game_id}`, {
|
|
const response = await fetch(`${PUBLIC_API_URL}/game/${game_id}`, {
|
|
|
method: "GET",
|
|
method: "GET",
|
|
|
- headers: {"Content-Type": "application/json"},
|
|
|
|
|
- credentials: "include"
|
|
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ "Content-Type": "application/json",
|
|
|
|
|
+ "Cookie": `user=${userCookie}`
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const data = await response.json();
|
|
const data = await response.json();
|