Skip to content

Commit

Permalink
chore: added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
saadjutt01 committed Dec 5, 2021
1 parent 712d154 commit 182de51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SASjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ export default class SASjs {

/**
* Checks whether a session is active, or login is required.
* @param accessToken - an optional access token is required for SASjs server type.
* @returns - a promise which resolves with an object containing two values - a boolean `isLoggedIn`, and a string `userName`.
*/
public async checkSession(accessToken?: string) {
Expand Down Expand Up @@ -564,6 +565,7 @@ export default class SASjs {

/**
* Logs out of the configured SAS server.
* @param accessToken - an optional access token is required for SASjs server type.
*/
public logOut(accessToken?: string) {
return this.authManager!.logOut(accessToken)
Expand Down
3 changes: 3 additions & 0 deletions src/auth/AuthManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export class AuthManager {

/**
* Checks whether a session is active, or login is required.
* @param accessToken - an optional access token is required for SASjs server type.
* @returns - a promise which resolves with an object containing three values
* - a boolean `isLoggedIn`
* - a string `userName` and
Expand Down Expand Up @@ -231,6 +232,7 @@ export class AuthManager {
? `${this.serverUrl}/SASStoredProcess`
: `${this.serverUrl}/SASjsApi/session`

// Access token is required for server type `SASjs`
const { result: loginResponse } = await this.requestClient
.get<string>(url, accessToken, 'text/plain')
.catch((err: any) => {
Expand Down Expand Up @@ -311,6 +313,7 @@ export class AuthManager {

/**
* Logs out of the configured SAS server.
* @param accessToken - an optional access token is required for SASjs server type.
*/
public logOut(accessToken?: string) {
if (this.serverType === ServerType.Sasjs) {
Expand Down
1 change: 1 addition & 0 deletions src/job-execution/WebJobExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export class WebJobExecutor extends BaseJobExecutor {
}

const requestPromise = new Promise((resolve, reject) => {
// Access token is required for server type `SASjs`
this.requestClient!.post(apiUrl, formData, authConfig?.access_token)
.then(async (res: any) => {
const resObj =
Expand Down

1 comment on commit 182de51

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

Total coverage

Status Category Percentage Covered / Total
🔴 Statements 58.26% 1604/2753
🔴 Branches 39.36% 551/1400
🔴 Functions 45.82% 230/502
🟡 Lines 67.41% 2563/3802

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from 182de51

Please sign in to comment.