Skip to content

Commit

Permalink
Merge pull request #950 from appwrite/fix-cookie-fallback
Browse files Browse the repository at this point in the history
fix: cookie fallback
  • Loading branch information
TorstenDittmann authored Aug 20, 2024
2 parents 52ab35c + 9cbad6d commit 92bbc9c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions templates/web/src/client.ts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,13 @@ class Client {

headers = Object.assign({}, this.headers, headers);

if (typeof window !== 'undefined' && window.localStorage) {
const cookieFallback = window.localStorage.getItem('cookieFallback');
if (cookieFallback) {
headers['X-Fallback-Cookies'] = cookieFallback;
}
}

let options: RequestInit = {
method,
headers,
Expand Down

0 comments on commit 92bbc9c

Please sign in to comment.