Include credentials in fetch

This commit is contained in:
Lucas Verney 2023-08-06 14:47:45 +02:00
parent 8725e26eaf
commit e7555d2f29
1 changed files with 3 additions and 3 deletions

View File

@ -269,7 +269,7 @@ var app = new Vue({
}, },
methods: { methods: {
search() { search() {
fetch(`${JUSTWATCH_API_DOMAIN}/content/titles/fr_FR/popular?language=fr&body={"page_size":20,"page":1,"query":"${this.title}","content_types":["show","movie"]}`) fetch(`${JUSTWATCH_API_DOMAIN}/content/titles/fr_FR/popular?language=fr&body={"page_size":20,"page":1,"query":"${this.title}","content_types":["show","movie"]}`, { credentials : "include" })
.then(response => response.json()) .then(response => response.json())
.then(response => { .then(response => {
this.error = null; this.error = null;
@ -307,7 +307,7 @@ var app = new Vue({
}, },
preloadItem(index) { preloadItem(index) {
var searchItem = this.searchItems[index]; var searchItem = this.searchItems[index];
fetch(`${JUSTWATCH_API_DOMAIN}/content/titles/${searchItem.type}/${searchItem.id}/locale/fr-FR?language=fr`) fetch(`${JUSTWATCH_API_DOMAIN}/content/titles/${searchItem.type}/${searchItem.id}/locale/fr-FR?language=fr`, { credentials : "include" })
.then(response => response.json()) .then(response => response.json())
.then(response => { .then(response => {
this.seasons = {}; this.seasons = {};
@ -342,7 +342,7 @@ var app = new Vue({
searchItem = this.seasons[index]; searchItem = this.seasons[index];
} }
var url = `${JUSTWATCH_API_DOMAIN}/content/titles/${searchItem.type}/${searchItem.id}/locale/${locale}?language=fr` var url = `${JUSTWATCH_API_DOMAIN}/content/titles/${searchItem.type}/${searchItem.id}/locale/${locale}?language=fr`
promises.push(fetch(url) promises.push(fetch(url, { credentials : "include" })
.then(response => response.json()) .then(response => response.json())
.then(response => { .then(response => {
if (!response.offers) { if (!response.offers) {