mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 11:26:18 +00:00
Fix cookie support in Node.js client (#895)
This commit is contained in:
@@ -417,7 +417,7 @@ class ApiClient {
|
||||
// Attach previously saved cookies, if enabled
|
||||
if (this.enableCookies){
|
||||
if (typeof window === 'undefined') {
|
||||
this.agent.attachCookies(request);
|
||||
this.agent._attachCookies(request);
|
||||
}
|
||||
else {
|
||||
request.withCredentials();
|
||||
@@ -433,7 +433,7 @@ class ApiClient {
|
||||
try {
|
||||
data = this.deserialize(response, returnType);
|
||||
if (this.enableCookies && typeof window === 'undefined'){
|
||||
this.agent.saveCookies(response);
|
||||
this.agent._saveCookies(response);
|
||||
}
|
||||
} catch (err) {
|
||||
error = err;
|
||||
|
||||
Reference in New Issue
Block a user