forked from loafle/openapi-generator-original
add withCredentials to the configuration (#5484)
* add withCredentials to the configuration 1. `withCredentials` in Request is `false` default 2. if want to set the `withCredentials` as `true` (for CORS request), instance `Configuration` object and set the `withCredentials` as `true`. * simplify the code according to the code review
This commit is contained in:
@@ -205,9 +205,8 @@ export class {{classname}} {
|
||||
body: formParams.toString(),
|
||||
{{/hasFormParams}}
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
|
||||
@@ -3,4 +3,5 @@ export class Configuration {
|
||||
username: string;
|
||||
password: string;
|
||||
accessToken: string | (() => string);
|
||||
withCredentials: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user