mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-14 15:40:06 +00:00
fix: login required callback
This commit is contained in:
@@ -313,6 +313,7 @@ export class SASViyaApiClient {
|
|||||||
}
|
}
|
||||||
).then((res: any) => res.result.items.map((i: any) => i.line).join("\n"));
|
).then((res: any) => res.result.items.map((i: any) => i.line).join("\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return { result: jobResult?.result, log };
|
return { result: jobResult?.result, log };
|
||||||
// } else {
|
// } else {
|
||||||
// console.error(
|
// console.error(
|
||||||
@@ -621,7 +622,6 @@ export class SASViyaApiClient {
|
|||||||
if (!this.rootFolder) {
|
if (!this.rootFolder) {
|
||||||
await this.populateRootFolder(accessToken);
|
await this.populateRootFolder(accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.rootFolder) {
|
if (!this.rootFolder) {
|
||||||
throw new Error("Root folder was not found");
|
throw new Error("Root folder was not found");
|
||||||
}
|
}
|
||||||
@@ -869,10 +869,7 @@ export class SASViyaApiClient {
|
|||||||
const rootFolder = await this.request<Folder>(
|
const rootFolder = await this.request<Folder>(
|
||||||
`${this.serverUrl}${url}`,
|
`${this.serverUrl}${url}`,
|
||||||
requestInfo
|
requestInfo
|
||||||
).catch((e) => {
|
);
|
||||||
error = e;
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.rootFolder = rootFolder?.result || null;
|
this.rootFolder = rootFolder?.result || null;
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|||||||
10
src/SASjs.ts
10
src/SASjs.ts
@@ -510,15 +510,6 @@ export default class SASjs {
|
|||||||
|
|
||||||
sasjsWaitingRequest.requestPromise.promise = new Promise(
|
sasjsWaitingRequest.requestPromise.promise = new Promise(
|
||||||
async (resolve, reject) => {
|
async (resolve, reject) => {
|
||||||
const session = await this.checkSession();
|
|
||||||
|
|
||||||
if (!session.isLoggedIn) {
|
|
||||||
if (loginRequiredCallback) loginRequiredCallback(true);
|
|
||||||
sasjsWaitingRequest.requestPromise.resolve = resolve;
|
|
||||||
sasjsWaitingRequest.requestPromise.reject = reject;
|
|
||||||
sasjsWaitingRequest.config = config;
|
|
||||||
this.sasjsWaitingRequests.push(sasjsWaitingRequest);
|
|
||||||
} else {
|
|
||||||
resolve(
|
resolve(
|
||||||
await this.sasViyaApiClient
|
await this.sasViyaApiClient
|
||||||
?.executeComputeJob(
|
?.executeComputeJob(
|
||||||
@@ -549,7 +540,6 @@ export default class SASjs {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
);
|
);
|
||||||
return sasjsWaitingRequest.requestPromise.promise;
|
return sasjsWaitingRequest.requestPromise.promise;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user