1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-07 12:30:06 +00:00

Compare commits

..

5 Commits

Author SHA1 Message Date
Yury Shkoda
4c4511913c Merge pull request #834 from sasjs/redirectLogin-fix
fix(auth-manager): fixed redirectedLoginUrl
2024-02-19 15:59:04 +03:00
Yury
8c64c24f3c chore: left a comment 2024-02-19 15:26:26 +03:00
Yury
1f2f445002 chore: fixed SASLogon URL in AuthManager test 2024-02-19 11:06:09 +03:00
Yury
6afa056a86 chore: testing 2024-02-19 10:58:23 +03:00
Yury
fe47ca1152 fix(auth-manager): fixed redirectedLoginUrl 2024-02-19 08:50:19 +03:00
3 changed files with 10 additions and 6 deletions

View File

@@ -22,8 +22,9 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
cache: npm cache: npm
- name: Check npm audit # FIXME: uncomment 'Check npm audit' step after axios version bump
run: npm audit --production --audit-level=low # - name: Check npm audit
# run: npm audit --production --audit-level=low
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: npm ci

View File

@@ -14,6 +14,7 @@ export class AuthManager {
private loginUrl: string private loginUrl: string
private logoutUrl: string private logoutUrl: string
private redirectedLoginUrl = `/SASLogon` //SAS 9 M8 no longer redirects from `/SASLogon/home` to the login page. `/SASLogon` seems to be stable enough across SAS versions private redirectedLoginUrl = `/SASLogon` //SAS 9 M8 no longer redirects from `/SASLogon/home` to the login page. `/SASLogon` seems to be stable enough across SAS versions
constructor( constructor(
private serverUrl: string, private serverUrl: string,
private serverType: ServerType, private serverType: ServerType,
@@ -27,6 +28,8 @@ export class AuthManager {
: this.serverType === ServerType.SasViya : this.serverType === ServerType.SasViya
? '/SASLogon/logout.do?' ? '/SASLogon/logout.do?'
: '/SASLogon/logout' : '/SASLogon/logout'
this.redirectedLoginUrl = this.serverUrl + this.redirectedLoginUrl
} }
/** /**

View File

@@ -365,7 +365,7 @@ describe('AuthManager', () => {
expect(loginResponse.userName).toEqual(userName) expect(loginResponse.userName).toEqual(userName)
expect(openWebPageModule.openWebPage).toHaveBeenCalledWith( expect(openWebPageModule.openWebPage).toHaveBeenCalledWith(
`/SASLogon`, `${serverUrl}/SASLogon`,
'SASLogon', 'SASLogon',
{ {
width: 500, width: 500,
@@ -409,7 +409,7 @@ describe('AuthManager', () => {
expect(loginResponse.userName).toEqual(userName) expect(loginResponse.userName).toEqual(userName)
expect(openWebPageModule.openWebPage).toHaveBeenCalledWith( expect(openWebPageModule.openWebPage).toHaveBeenCalledWith(
`/SASLogon`, `${serverUrl}/SASLogon`,
'SASLogon', 'SASLogon',
{ {
width: 500, width: 500,
@@ -453,7 +453,7 @@ describe('AuthManager', () => {
expect(loginResponse.userName).toEqual('') expect(loginResponse.userName).toEqual('')
expect(openWebPageModule.openWebPage).toHaveBeenCalledWith( expect(openWebPageModule.openWebPage).toHaveBeenCalledWith(
`/SASLogon`, `${serverUrl}/SASLogon`,
'SASLogon', 'SASLogon',
{ {
width: 500, width: 500,
@@ -497,7 +497,7 @@ describe('AuthManager', () => {
expect(loginResponse.userName).toEqual('') expect(loginResponse.userName).toEqual('')
expect(openWebPageModule.openWebPage).toHaveBeenCalledWith( expect(openWebPageModule.openWebPage).toHaveBeenCalledWith(
`/SASLogon`, `${serverUrl}/SASLogon`,
'SASLogon', 'SASLogon',
{ {
width: 500, width: 500,