@sbc-connect/nuxt-auth 0.16.3 → 0.16.4

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,11 @@
1
1
  # @sbc-connect/nuxt-auth
2
2
 
3
+ ## 0.16.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#192](https://github.com/bcgov/connect-nuxt/pull/192) [`7a8ed9f`](https://github.com/bcgov/connect-nuxt/commit/7a8ed9f6ab50bafb165d5fe0dc90477ec7917458) Thanks [@kialj876](https://github.com/kialj876)! - Login description can be set by the preset override
8
+
3
9
  ## 0.16.3
4
10
 
5
11
  ### Patch Changes
@@ -5,6 +5,7 @@ export interface ConnectLoginConfig {
5
5
  idps: IdpList
6
6
  skipAccountRedirect: boolean
7
7
  idpEnforcement: boolean
8
+ description?: string | null
8
9
  alert?: {
9
10
  title?: string
10
11
  message?: string
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import loginImage from '#auth/public/img/BCReg_Generic_Login_image.jpg'
3
3
 
4
- const { t } = useI18n()
4
+ const { t, te } = useI18n()
5
5
  const { login } = useConnectAuth()
6
6
  const ac = useAppConfig().connect.login
7
7
 
@@ -18,6 +18,21 @@ definePageMeta({
18
18
 
19
19
  const isSessionExpired = sessionStorage.getItem(ConnectAuthStorageKey.CONNECT_SESSION_EXPIRED)
20
20
 
21
+ // app config (or preset) description overrides the default text
22
+ // - either an i18n key or a literal string
23
+ // - undefined (not specified) uses the default text
24
+ // - empty string or null hides the description
25
+ const description = computed(() => {
26
+ const override = ac.description
27
+ if (override === undefined) {
28
+ return t('connect.page.login.description')
29
+ }
30
+ if (!override) {
31
+ return ''
32
+ }
33
+ return te(override) ? t(override) : override
34
+ })
35
+
21
36
  const loginOptions = computed(() => {
22
37
  const loginOptionsMap: Record<
23
38
  ConnectValidIdpOption,
@@ -64,8 +79,12 @@ const loginOptions = computed(() => {
64
79
  <h1>
65
80
  {{ $t('connect.page.login.h1') }}
66
81
  </h1>
67
- <p class="max-w-[40rem] text-center">
68
- {{ $t('connect.page.login.description') }}
82
+ <p
83
+ v-if="description"
84
+ class="max-w-[40rem] text-center"
85
+ data-testid="login-description"
86
+ >
87
+ {{ description }}
69
88
  </p>
70
89
  <UAlert
71
90
  v-if="isSessionExpired"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sbc-connect/nuxt-auth",
3
3
  "type": "module",
4
- "version": "0.16.3",
4
+ "version": "0.16.4",
5
5
  "repository": "github:bcgov/connect-nuxt",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "./nuxt.config.ts",