@sbc-connect/nuxt-auth 0.12.0 → 0.13.1
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,17 @@
|
|
|
1
1
|
# @sbc-connect/nuxt-auth
|
|
2
2
|
|
|
3
|
+
## 0.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#176](https://github.com/bcgov/connect-nuxt/pull/176) [`cc88169`](https://github.com/bcgov/connect-nuxt/commit/cc88169964e9c5aa845ac2c7bec6795f6187bf32) Thanks [@deetz99](https://github.com/deetz99)! - Create account page: Add optional body text and hide back button if user has 0 accounts
|
|
8
|
+
|
|
9
|
+
## 0.13.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#174](https://github.com/bcgov/connect-nuxt/pull/174) [`0f7a1d5`](https://github.com/bcgov/connect-nuxt/commit/0f7a1d56fedcd40d297780ca8847b8d253b512f6) Thanks [@deetz99](https://github.com/deetz99)! - Force token refresh after user is created in auth for new users (0 accounts) only.
|
|
14
|
+
|
|
3
15
|
## 0.12.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -25,6 +25,12 @@ const pageTitle = computed(() =>
|
|
|
25
25
|
? $t('connect.label.existingAccountFound')
|
|
26
26
|
: $t('connect.label.sbcAccountCreation')
|
|
27
27
|
)
|
|
28
|
+
const createAccountDesc = computed(() => {
|
|
29
|
+
const desc = useNuxtApp().$i18n.tm('connect.page.createAccount.description')
|
|
30
|
+
return Array.isArray(desc) && (desc as Array<unknown>).length > 0
|
|
31
|
+
? desc
|
|
32
|
+
: []
|
|
33
|
+
})
|
|
28
34
|
|
|
29
35
|
useHead({
|
|
30
36
|
title: pageTitle
|
|
@@ -69,9 +75,14 @@ onBeforeMount(() => {
|
|
|
69
75
|
<template>
|
|
70
76
|
<UContainer class="max-w-6xl">
|
|
71
77
|
<ConnectTransitionFade>
|
|
72
|
-
<div class="space-y-
|
|
78
|
+
<div class="space-y-4 sm:space-y-6">
|
|
73
79
|
<h1>{{ pageTitle }}</h1>
|
|
74
80
|
<ConnectAccountExistingAlert v-if="showAccountList" />
|
|
81
|
+
<div v-else-if="!showAccountList && createAccountDesc.length" class="space-y-2">
|
|
82
|
+
<p v-for="text in createAccountDesc" :key="text">
|
|
83
|
+
{{ $rt(text) }}
|
|
84
|
+
</p>
|
|
85
|
+
</div>
|
|
75
86
|
</div>
|
|
76
87
|
</ConnectTransitionFade>
|
|
77
88
|
|
|
@@ -124,6 +135,7 @@ onBeforeMount(() => {
|
|
|
124
135
|
data-testid="create-account-button-wrapper"
|
|
125
136
|
>
|
|
126
137
|
<UButton
|
|
138
|
+
v-if="store.userAccounts.length > 0"
|
|
127
139
|
variant="outline"
|
|
128
140
|
:label="$t('connect.label.back')"
|
|
129
141
|
:disabled="isSubmitting"
|
|
@@ -4,15 +4,21 @@ export default defineNuxtPlugin({
|
|
|
4
4
|
dependsOn: ['connect-auth', 'auth-api'],
|
|
5
5
|
parallel: true,
|
|
6
6
|
async setup(nuxtApp) {
|
|
7
|
-
const { isAuthenticated } = useConnectAuth()
|
|
7
|
+
const { isAuthenticated, getToken } = useConnectAuth()
|
|
8
8
|
const store = useConnectAccountStore()
|
|
9
9
|
|
|
10
10
|
if (isAuthenticated.value) {
|
|
11
|
-
//
|
|
11
|
+
// Initialize user accounts and user profile on app mount
|
|
12
12
|
await Promise.all([
|
|
13
13
|
store.initAccountStore(),
|
|
14
14
|
store.syncUserProfile()
|
|
15
15
|
])
|
|
16
|
+
|
|
17
|
+
// Force token refresh to return updated roles
|
|
18
|
+
// Required only for new users
|
|
19
|
+
if (store.userAccounts.length === 0) {
|
|
20
|
+
await getToken(true)
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
// sync user profile whenever the token is updated
|
package/i18n/locales/en-CA.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbc-connect/nuxt-auth",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.1",
|
|
5
5
|
"repository": "github:bcgov/connect-nuxt",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"typescript": "6.0.3",
|
|
13
13
|
"vue-tsc": "3.3.1",
|
|
14
14
|
"@sbc-connect/eslint-config": "0.0.8",
|
|
15
|
-
"@sbc-connect/
|
|
16
|
-
"@sbc-connect/
|
|
15
|
+
"@sbc-connect/playwright-config": "0.2.0",
|
|
16
|
+
"@sbc-connect/vitest-config": "0.2.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@pinia/colada": "1.3.0",
|