1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-10 17:04:36 +00:00

fix: sasjs login login callback

This commit is contained in:
2022-04-29 14:26:34 +02:00
parent 3c59db91cd
commit e2e15ce8e1
3 changed files with 62 additions and 3 deletions

View File

@@ -22,19 +22,75 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Check npm audit
run: npm audit --production --audit-level=low
- name: Install Dependencies
run: npm ci
- name: Check code style
run: npm run lint
- name: Run unit tests
run: npm test
- name: Generate coverage report
uses: artiomtr/jest-coverage-report-action@v2.0-rc.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Package
run: npm run package:lib
env:
CI: true
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DCGITLAB_KEY }}
known_hosts: 'placeholder'
- name: Write VPN Files
run: |
echo "$CA_CRT" > .github/vpn/ca.crt
echo "$USER_CRT" > .github/vpn/user.crt
echo "$USER_KEY" > .github/vpn/user.key
echo "$TLS_KEY" > .github/vpn/tls.key
shell: bash
env:
CA_CRT: ${{ secrets.CA_CRT}}
USER_CRT: ${{ secrets.USER_CRT }}
USER_KEY: ${{ secrets.USER_KEY }}
TLS_KEY: ${{ secrets.TLS_KEY }}
- name: Install Open VPN
run: |
sudo apt install apt-transport-https
sudo wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub
sudo apt-key add openvpn-repo-pkg-key.pub
sudo wget -O /etc/apt/sources.list.d/openvpn3.list https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-focal.list
sudo apt update
sudo apt install openvpn3=16~beta+focal
- name: Start Open VPN 3
run: openvpn3 session-start --config .github/vpn/config.ovpn
- name: Deploy sasjs-tests
run: |
npm install -g replace-in-files-cli
cd sasjs-tests
replace-in-files --regex='"@sasjs/adapter".*' --replacement='"@sasjs/adapter":"latest",' ./package.json
npm i
replace-in-files --regex='"userName".*' --replacement='"userName":"${{ secrets.SASJS_USERNAME }}",' ./public/config.json
replace-in-files --regex='"password".*' --replacement='"password":"${{ secrets.SASJS_PASSWORD }}",' ./public/config.json
replace-in-files --regex='"serverType".*' --replacement='"serverType":"SASJS",' ./public/config.json
npm run update:adapter && npm run build
scp -o stricthostkeychecking=no -r ./build/* ${{ secrets.DCGITLAB_DEPLOY_PATH_VIYA }}
- name: Run cypress on sasjs
run: |
replace-in-files --regex='"sasjsTestsUrl".*' --replacement='"sasjsTestsUrl":"${{ secrets.SASJS_TEST_URL_VIYA }}",' ./cypress.json
replace-in-files --regex='"username".*' --replacement='"username":"${{ secrets.SASJS_USERNAME }}",' ./cypress.json
replace-in-files --regex='"password".*' --replacement='"password":"${{ secrets.SASJS_PASSWORD }}",' ./cypress.json
sh ./sasjs-cypress-run.sh ${{ secrets.SLACK_WEBHOOK }}

View File

@@ -2604,7 +2604,7 @@
"node_modules/@sasjs/adapter": {
"version": "5.0.0",
"resolved": "file:../build/sasjs-adapter-5.0.0.tgz",
"integrity": "sha512-Sr2fkOl/WqqnmZEsiCURe1+dYicuj3gE8lvzhFA1oiKUVKg0Ho552MsQvIg4qreqSmPWpHE7IY41c0tJw0sxkA==",
"integrity": "sha512-ARa1FFOHFdiVI/oHngmd5AJv6OZxeCwcHkpYEdrpY5syCg3hvTBYvmUZmxN4cRzwSsxAdiO9NGrHMgHbn5fV0Q==",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
@@ -23331,7 +23331,7 @@
},
"@sasjs/adapter": {
"version": "file:../build/sasjs-adapter-5.0.0.tgz",
"integrity": "sha512-Sr2fkOl/WqqnmZEsiCURe1+dYicuj3gE8lvzhFA1oiKUVKg0Ho552MsQvIg4qreqSmPWpHE7IY41c0tJw0sxkA==",
"integrity": "sha512-ARa1FFOHFdiVI/oHngmd5AJv6OZxeCwcHkpYEdrpY5syCg3hvTBYvmUZmxN4cRzwSsxAdiO9NGrHMgHbn5fV0Q==",
"requires": {
"@sasjs/utils": "2.44.0",
"axios": "0.26.0",

View File

@@ -100,12 +100,15 @@ export class AuthManager {
password,
clientId
)
.then((res) => {
.then(async (res) => {
this.userName = username
this.requestClient.saveLocalStorageToken(
res.access_token,
res.refresh_token
)
await this.loginCallback()
return true
})
.catch(() => false)