Include credentials in requests (#721)

* feat(request manager): adds header to send cookies, and other auths with every request

* refactor(.gitignore): removes local env from .gitignores
This commit is contained in:
Angel
2024-04-09 18:04:30 -04:00
committed by GitHub
parent 1519d0447e
commit 5f7240d93b
3 changed files with 5 additions and 3 deletions

View File

@@ -138,7 +138,7 @@ export class GraphQLClient extends BaseClient<
} }
private createUploadLink() { private createUploadLink() {
return createUploadLink({ uri: () => this.getBaseUrl() }); return createUploadLink({ uri: () => this.getBaseUrl(), credentials: 'include' });
} }
private createWSLink() { private createWSLink() {

View File

@@ -27,7 +27,9 @@ export class RestClient
extends BaseClient<typeof fetch, RequestInit, (url: string, data: any) => Promise<Response>> extends BaseClient<typeof fetch, RequestInit, (url: string, data: any) => Promise<Response>>
implements IRestClient implements IRestClient
{ {
private config: RequestInit = {}; private config: RequestInit = {
credentials: 'include',
};
public readonly fetcher = async ( public readonly fetcher = async (
url: string, url: string,