1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-05 11:40:06 +00:00

chore: for VIYA calling API endpoint

This commit is contained in:
2021-03-28 21:55:47 +02:00
parent dce8a08a86
commit 9da2a29a72

View File

@@ -82,14 +82,15 @@ export class AuthManager {
* @returns - a promise which resolves with an object containing two values - a boolean `isLoggedIn`, and a string `userName`.
*/
public async checkSession() {
//For VIYA we will send request on API endpoint. Which is faster then pinging SASJobExecution.
//For SAS9 we will send request on SASStoredProcess
const url =
this.serverType === 'SASVIYA'
? `${this.serverUrl}/identities`
: `${this.serverUrl}/SASStoredProcess`
const { result: loginResponse } = await this.requestClient
.get<string>(
`${this.serverUrl}/${
this.serverType === 'SASVIYA' ? 'SASJobExecution' : 'SASStoredProcess'
}`,
undefined,
'text/plain'
)
.get<string>(url, undefined, 'text/plain')
.catch((err: any) => {
return { result: 'authErr' }
})