mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-08 21:10:05 +00:00
fix(*): handle login required state, fix session creation logic
This commit is contained in:
@@ -661,7 +661,7 @@ export class SASViyaApiClient {
|
||||
contextName,
|
||||
accessToken,
|
||||
"",
|
||||
false,
|
||||
true,
|
||||
data,
|
||||
debug
|
||||
);
|
||||
@@ -864,12 +864,19 @@ export class SASViyaApiClient {
|
||||
if (accessToken) {
|
||||
requestInfo.headers = { Authorization: `Bearer ${accessToken}` };
|
||||
}
|
||||
let error;
|
||||
const rootFolder = await this.request<Folder>(
|
||||
`${this.serverUrl}${url}`,
|
||||
requestInfo
|
||||
).catch(() => null);
|
||||
).catch((e) => {
|
||||
error = e;
|
||||
return null;
|
||||
});
|
||||
|
||||
this.rootFolder = rootFolder?.result || null;
|
||||
if (error) {
|
||||
throw new Error(JSON.stringify(error));
|
||||
}
|
||||
}
|
||||
|
||||
private async pollJobState(
|
||||
|
||||
Reference in New Issue
Block a user