File tree Expand file tree Collapse file tree 3 files changed +5646
-5637
lines changed Expand file tree Collapse file tree 3 files changed +5646
-5637
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ import type { ApiRequestOptions } from './ApiRequestOptions';
4
4
5
5
type Resolver<T > = (options: ApiRequestOptions) => Promise<T >;
6
6
type Headers = Record<string , string>;
7
+ type CredentialModes = 'include' | 'omit' | 'same-origin'
7
8
8
9
type Config = {
9
10
BASE: string;
10
11
VERSION: string;
11
12
WITH_CREDENTIALS: boolean;
13
+ CREDENTIALS: CredentialModes;
12
14
TOKEN?: string | Resolver<string >;
13
15
USERNAME?: string | Resolver<string >;
14
16
PASSWORD?: string | Resolver<string >;
@@ -20,6 +22,7 @@ export const OpenAPI: Config = {
20
22
BASE: '{{{ server }}} ',
21
23
VERSION: '{{{ version }}} ',
22
24
WITH_CREDENTIALS: false,
25
+ CREDENTIALS: 'include',
23
26
TOKEN: undefined,
24
27
USERNAME: undefined,
25
28
PASSWORD: undefined,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ async function sendRequest(
16
16
};
17
17
18
18
if (OpenAPI.WITH_CREDENTIALS) {
19
- request.credentials = 'include' ;
19
+ request.credentials = OpenAPI.CREDENTIALS ;
20
20
}
21
21
22
22
onCancel(() => controller.abort());
You can’t perform that action at this time.
0 commit comments