1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 09:24:35 +00:00

Merge pull request #42 from sasjs/issue41

fix: csrfTokenWeb setter callback
This commit is contained in:
Allan Bowe
2020-08-18 13:22:33 +02:00
committed by GitHub
2 changed files with 12 additions and 2 deletions

View File

@@ -9,7 +9,8 @@ export class FileUploader {
private appLoc: string,
private serverUrl: string,
private jobsPath: string,
private csrfToken: CsrfToken | null = null
private setCsrfTokenWeb: any,
private csrfToken: CsrfToken | null = null,
) {}
private retryCount = 0;
@@ -61,6 +62,8 @@ export class FileUploader {
headerName: tokenHeader,
value: token || "",
};
this.setCsrfTokenWeb(this.csrfToken);
}
}
}

View File

@@ -399,8 +399,10 @@ export default class SASjs {
this.sasjsConfig.appLoc,
this.sasjsConfig.serverUrl,
this.jobsPath,
this.setCsrfTokenWeb,
this.csrfTokenWeb
);
return fileUploader.uploadFile(sasJob, files, params);
}
@@ -911,6 +913,10 @@ export default class SASjs {
return sasjsWaitingRequest.requestPromise.promise;
}
private setCsrfTokenWeb = (csrfToken: CsrfToken) => {
this.csrfTokenWeb = csrfToken;
};
private setCsrfTokenApi = (csrfToken: CsrfToken) => {
this.csrfTokenApi = csrfToken;
@@ -1177,7 +1183,8 @@ export default class SASjs {
this.fileUploader = new FileUploader(
this.sasjsConfig.appLoc,
this.sasjsConfig.serverUrl,
this.jobsPath
this.jobsPath,
this.setCsrfTokenWeb
);
}