@sbc-connect/nuxt-auth 0.16.4 → 0.16.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @sbc-connect/nuxt-auth
2
2
 
3
+ ## 0.16.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#197](https://github.com/bcgov/connect-nuxt/pull/197) [`3ed5c7f`](https://github.com/bcgov/connect-nuxt/commit/3ed5c7f7df24773dcd231be1029f8b87f41a6f0e) Thanks [@panish16](https://github.com/panish16)! - Upgrade to pnpm 11.9.0 ([#182](https://github.com/bcgov/connect-nuxt/issues/182)) and stabilise the flaky WebKit/iPad e2e tests with retries, higher timeouts, and CI path filters that actually trigger on shared config changes ([#196](https://github.com/bcgov/connect-nuxt/issues/196))
8
+
9
+ - Updated dependencies [[`3ed5c7f`](https://github.com/bcgov/connect-nuxt/commit/3ed5c7f7df24773dcd231be1029f8b87f41a6f0e)]:
10
+ - @sbc-connect/nuxt-base@0.13.3
11
+ - @sbc-connect/nuxt-forms@0.7.11
12
+
13
+ ## 0.16.5
14
+
15
+ ### Patch Changes
16
+
17
+ - [#194](https://github.com/bcgov/connect-nuxt/pull/194) [`a765c6e`](https://github.com/bcgov/connect-nuxt/commit/a765c6e9a87608e7a2c6e07abffd410a1e7e30c7) Thanks [@kialj876](https://github.com/kialj876)! - 34765 Auth - allow pre selecting login from redirect
18
+
3
19
  ## 0.16.4
4
20
 
5
21
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  export default defineNuxtRouteMiddleware(async (to) => {
2
- const { isAuthenticated } = useConnectAuth()
2
+ const { isAuthenticated, login } = useConnectAuth()
3
3
  const rtc = useRuntimeConfig().public
4
4
  const localePath = useLocalePath()
5
5
  const service = useConnectAuthService()
@@ -8,6 +8,19 @@ export default defineNuxtRouteMiddleware(async (to) => {
8
8
  const isLoginPage = to.meta.connectLogin === true
9
9
  const isTosPage = to.meta.connectTosPage === true
10
10
 
11
+ // a valid idp query param (e.g. ?idp=bcsc) triggers that login instead of showing the login options
12
+ // - the idp must be in the app's allowed idps list
13
+ if (!isAuthenticated.value && !rtc.playwright) {
14
+ const idp = String(to.query.idp ?? '')
15
+ if ((useAppConfig().connect.login.idps as string[]).includes(idp)) {
16
+ // remove the idp param from the Keycloak redirect URI so a cancelled login
17
+ // returns to the login options instead of re-triggering
18
+ const redirectUrl = new URL(`${rtc.baseUrl}${to.fullPath.slice(1)}`)
19
+ redirectUrl.searchParams.delete('idp')
20
+ return login(idp as ConnectIdpHint, redirectUrl.href)
21
+ }
22
+ }
23
+
11
24
  if (!isAuthenticated.value && !isLoginPage && !rtc.playwright) {
12
25
  const defaultReturn = `${rtc.baseUrl}${to.fullPath.slice(1)}`
13
26
  const returnUrl = (to.query.return && String(to.query.return)) || defaultReturn
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@sbc-connect/nuxt-auth",
3
3
  "type": "module",
4
- "version": "0.16.4",
5
- "repository": "github:bcgov/connect-nuxt",
4
+ "version": "0.16.6",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "github:bcgov/connect-nuxt"
8
+ },
6
9
  "license": "BSD-3-Clause",
7
10
  "main": "./nuxt.config.ts",
8
11
  "devDependencies": {
@@ -12,7 +15,7 @@
12
15
  "typescript": "6.0.3",
13
16
  "vue-tsc": "3.3.1",
14
17
  "@sbc-connect/eslint-config": "0.0.8",
15
- "@sbc-connect/playwright-config": "0.2.0",
18
+ "@sbc-connect/playwright-config": "0.2.1",
16
19
  "@sbc-connect/vitest-config": "0.2.0"
17
20
  },
18
21
  "dependencies": {
@@ -22,8 +25,8 @@
22
25
  "keycloak-js": "26.2.4",
23
26
  "pinia": "3.0.4",
24
27
  "pinia-plugin-persistedstate": "4.7.1",
25
- "@sbc-connect/nuxt-base": "0.13.2",
26
- "@sbc-connect/nuxt-forms": "0.7.10"
28
+ "@sbc-connect/nuxt-base": "0.13.3",
29
+ "@sbc-connect/nuxt-forms": "0.7.11"
27
30
  },
28
31
  "scripts": {
29
32
  "preinstall": "npx only-allow pnpm",