diff --git a/.github/workflows/build-and-test-oauth.yml b/.github/workflows/build-and-test-oauth.yml index ba0f580866..8cb9ffe7d4 100644 --- a/.github/workflows/build-and-test-oauth.yml +++ b/.github/workflows/build-and-test-oauth.yml @@ -141,7 +141,7 @@ jobs: - name: Check running containers run: docker ps -a - - name: Caputre Hydra Oauth Service logs + - name: Capture Hydra Oauth Service logs run: | mkdir -p ./e2e-tests/logs docker logs hydra > ./e2e-tests/logs/hydra.out & @@ -166,7 +166,6 @@ jobs: npm install npm run backend:dropAllDBTables npm run cyServices:start:skills-service:oauth - npm run cyServices:start:client-display:oauth cd .. - name: Run Cypress tests diff --git a/dashboard-prime/src/components/access/Login.vue b/dashboard-prime/src/components/access/Login.vue index 9d00a2f8eb..0ff2e2370f 100644 --- a/dashboard-prime/src/components/access/Login.vue +++ b/dashboard-prime/src/components/access/Login.vue @@ -81,7 +81,7 @@ onBeforeMount(() => { } }) const oAuth2Login = (registrationId) => { - // this.$store.dispatch('oAuth2Login', registrationId); + authState.oAuth2Login(registrationId) } diff --git a/dashboard-prime/src/stores/UseAuthState.js b/dashboard-prime/src/stores/UseAuthState.js index f7f00165a3..ae55ca1341 100644 --- a/dashboard-prime/src/stores/UseAuthState.js +++ b/dashboard-prime/src/stores/UseAuthState.js @@ -1,5 +1,5 @@ import { computed, ref } from 'vue' -import { useRouter } from 'vue-router' +import { useRoute, useRouter } from 'vue-router' import { defineStore } from 'pinia' import axios from 'axios' import { SkillsConfiguration } from '@skilltree/skills-client-js' @@ -17,6 +17,7 @@ export const useAuthState = defineStore('authState', () => { const oAuthAuth = ref(false) const router = useRouter() + const route = useRoute() const appConfig = useAppConfig() const appInfoState = useAppInfoState() @@ -95,8 +96,9 @@ export const useAuthState = defineStore('authState', () => { } const oAuth2Login = (oAuthId) => { setOauth2AuthUser() - const { redirect } = router.currentRoute.query - window.location = `/oauth2/authorization/${encodeURIComponent(oAuthId)}${redirect ? `?skillsRedirectUri=${redirect}` : ''}` + const redirect = route.query.redirect + const newLocation = `/oauth2/authorization/${encodeURIComponent(oAuthId)}${redirect ? `?skillsRedirectUri=${redirect}` : ''}` + window.location = newLocation } const restoreSessionIfAvailable = () => { setRestoringSession(true) diff --git a/e2e-tests/package.json b/e2e-tests/package.json index 6386476ff6..76933c6df8 100644 --- a/e2e-tests/package.json +++ b/e2e-tests/package.json @@ -50,7 +50,7 @@ "backend:start:verifyEmail:ci": "mkdir -p ./logs && npm run backend:start:verifyEmail > ./logs/skills-service.out &", "backend:start:oauth:ci": "mkdir -p ./logs && npm run backend:start:oauth > ./logs/skills-service.out &", "backend:start:rabbitmq:ci": "mkdir -p ./logs && npm run backend:start:rabbitmq > ./logs/skills-service.out &", - "backend:waitToStart": "npx wait-on -t 160000 http://localhost:8080", + "backend:waitToStart": "echo \"Started waiting for skills-service at[$(date)]\" && npx wait-on -t 160000 http://localhost:8080", "backend:resetDb": "export PGPASSWORD=skillsPassword && psql -U postgres -h $npm_package_config_dbHost -d $npm_package_config_dbName -f ./cypress/db/reset.sql", "backend:clearDb": "export PGPASSWORD=skillsPassword && psql -U postgres -h $npm_package_config_dbHost -d $npm_package_config_dbName -f ./cypress/db/clear.sql", "backend:setupInviteOnly": "export PGPASSWORD=skillsPassword && psql -U postgres -h $npm_package_config_dbHost -d $npm_package_config_dbName -f ./cypress/db/createInviteOnlyProject.sql",