Skip to content

Commit e789528

Browse files
Séafraalanpq
authored andcommitted
fix: include credentials in all requests to support cross-site api location
1 parent 8065a70 commit e789528

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/CoralServer.svelte.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export class CoralServer {
3535
const token = building ? '' : page.url.searchParams.get('token');
3636
return createClient<paths>({
3737
baseUrl: `${(config.PUBLIC_API_PATH || base) ?? '/'}`,
38-
headers: { Authorization: token ? `Bearer ${token}` : undefined }
38+
headers: { Authorization: token ? `Bearer ${token}` : undefined },
39+
credentials: 'include'
3940
});
4041
});
4142

@@ -170,7 +171,7 @@ export class CoralServer {
170171
}
171172

172173
public async fetchRegistries() {
173-
const res = await this.api.GET('/api/v1/registry');
174+
const res = await this.api.GET('/api/v1/registry', { credentials: 'include' });
174175
if (res.error) throw new Error(`Error fetching registries`);
175176
this.catalogs = Object.fromEntries(
176177
res.data.map((r) => [

0 commit comments

Comments
 (0)