mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-07 04:20:05 +00:00
chore: for VIYA calling API endpoint
This commit is contained in:
@@ -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`.
|
* @returns - a promise which resolves with an object containing two values - a boolean `isLoggedIn`, and a string `userName`.
|
||||||
*/
|
*/
|
||||||
public async checkSession() {
|
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
|
const { result: loginResponse } = await this.requestClient
|
||||||
.get<string>(
|
.get<string>(url, undefined, 'text/plain')
|
||||||
`${this.serverUrl}/${
|
|
||||||
this.serverType === 'SASVIYA' ? 'SASJobExecution' : 'SASStoredProcess'
|
|
||||||
}`,
|
|
||||||
undefined,
|
|
||||||
'text/plain'
|
|
||||||
)
|
|
||||||
.catch((err: any) => {
|
.catch((err: any) => {
|
||||||
return { result: 'authErr' }
|
return { result: 'authErr' }
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user