@sbc-connect/nuxt-auth 0.1.2 → 0.1.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,30 @@
1
1
  # @sbc-connect/nuxt-auth
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#16](https://github.com/bcgov/connect-nuxt/pull/16) [`9b8c225`](https://github.com/bcgov/connect-nuxt/commit/9b8c225a011e3c89c9b490e93a554f55a4e29b78) Thanks [@kialj876](https://github.com/kialj876)! - - add base header components (logo, localeSelect, wrapper)
8
+
9
+ - add footer component
10
+ - appendUrlParam util
11
+
12
+ issue: bcgov/entity#29334
13
+
14
+ - Updated dependencies [[`90f240f`](https://github.com/bcgov/connect-nuxt/commit/90f240fd789a5286ded5df710bddd6dc953bcba5), [`0fb8c54`](https://github.com/bcgov/connect-nuxt/commit/0fb8c54e059d78b246b80a03f049d075b7bbcf72), [`9b8c225`](https://github.com/bcgov/connect-nuxt/commit/9b8c225a011e3c89c9b490e93a554f55a4e29b78)]:
15
+ - @sbc-connect/nuxt-base@0.1.4
16
+
17
+ ## 0.1.3
18
+
19
+ ### Patch Changes
20
+
21
+ - [#9](https://github.com/bcgov/connect-nuxt/pull/9) [`e841fde`](https://github.com/bcgov/connect-nuxt/commit/e841fde27630d63efb2c152cd78d92b1193d1d5e) Thanks [@kialj876](https://github.com/kialj876)! - Add Nuxt back as a dev dependency
22
+
23
+ - [#8](https://github.com/bcgov/connect-nuxt/pull/8) [`c85ebfc`](https://github.com/bcgov/connect-nuxt/commit/c85ebfc879e19cce307b109c9d38044f71f482d2) Thanks [@kialj876](https://github.com/kialj876)! - Added in i18n, added base header components, added in styles for nuxt ui
24
+
25
+ - Updated dependencies [[`e841fde`](https://github.com/bcgov/connect-nuxt/commit/e841fde27630d63efb2c152cd78d92b1193d1d5e), [`c85ebfc`](https://github.com/bcgov/connect-nuxt/commit/c85ebfc879e19cce307b109c9d38044f71f482d2)]:
26
+ - @sbc-connect/nuxt-base@0.1.3
27
+
3
28
  ## 0.1.2
4
29
 
5
30
  ### Patch Changes
package/README.md CHANGED
@@ -1,73 +1,65 @@
1
- # Nuxt Layer Starter
1
+ [![License](https://img.shields.io/badge/License-BSD%203%20Clause-blue.svg)](LICENSE) [![pkg.pr.new](https://pkg.pr.new/badge/OWNER/REPO)](https://pkg.pr.new/~/bcgov/connect-nuxt)
2
2
 
3
- Create Nuxt extendable layer with this GitHub template.
3
+ # @sbc-connect/nuxt-auth
4
+ A Nuxt layer for handling user authentication and session management within the Connect ecosystem.
4
5
 
5
- ## Setup
6
+ This package provides the necessary composables, plugins, and logic to integrate authentication into a Nuxt application, offering a secure and standardized login experience.
6
7
 
7
- Make sure to install the dependencies:
8
+ ## Features
9
+ ### Authentication & Session Management
10
+ - Integration with the BC Government authentication provider.
11
+ - User session management.
12
+ - User account management.
8
13
 
9
- ```bash
10
- pnpm install
11
- ```
12
-
13
- ## Working on your layer
14
-
15
- Your layer is at the root of this repository, it is exactly like a regular Nuxt project, except you can publish it on NPM.
16
-
17
- The `.playground` directory should help you on trying your layer during development.
14
+ ### Core Development Assets
15
+ - useConnectAuth() composable to access user information and token state.
16
+ - login() and logout() helper functions.
17
+ - Automatic token refreshing and session validation.
18
18
 
19
- Running `pnpm dev` will prepare and boot `.playground` directory, which imports your layer itself.
19
+ For detailed usage and documentation, please see the [Auth Layer Docs](../../../docs/packages/layers/auth/intro.md).
20
20
 
21
- ## Distributing your layer
21
+ ## Usage
22
22
 
23
- Your Nuxt layer is shaped exactly the same as any other Nuxt project, except you can publish it on NPM.
24
-
25
- To do so, you only have to check if `files` in `package.json` are valid, then run:
23
+ ### Install
26
24
 
27
25
  ```bash
28
- npm publish --access public
26
+ pnpm install @sbc-connect/nuxt-auth
29
27
  ```
30
28
 
31
- Once done, your users will only have to run:
32
-
33
- ```bash
34
- npm install --save your-layer
35
- ```
29
+ ### Configure
30
+ Then add the dependency to `extends` in `nuxt.config`:
36
31
 
37
- Then add the dependency to their `extends` in `nuxt.config`:
32
+ > [!NOTE]
33
+ > `@sbc-connect/nuxt-auth` already includes `@sbc-connect/nuxt-base`, it is not necessary to install `@sbc-connect/nuxt-base`.
38
34
 
39
35
  ```ts
40
36
  defineNuxtConfig({
41
- extends: 'your-layer'
37
+ extends: '@sbc-connect/nuxt-auth'
42
38
  })
43
39
  ```
44
40
 
45
- ## Development Server
41
+ ## Environment Variables
42
+ This project requires certain environment variables to be set to run correctly.
46
43
 
47
- Start the development server on http://localhost:3000
44
+ Create a file named .env in the root of the project.
48
45
 
49
- ```bash
50
- pnpm dev
51
- ```
52
-
53
- ## Production
46
+ Copy the contents of the .env.example file into your new .env file.
54
47
 
55
- Build the application for production:
48
+ ### Local Development
49
+ For local development, you will need credentials for the development instance of the authentication provider.
56
50
 
57
- ```bash
58
- pnpm build
59
51
  ```
60
-
61
- Or statically generate it with:
62
-
63
- ```bash
64
- pnpm generate
52
+ # .env
53
+ NUXT_PUBLIC_AUTH_PROVIDER_URL="https://dev.oidc.gov.bc.ca/auth"
54
+ NUXT_PUBLIC_AUTH_PROVIDER_REALM="your-realm-name"
55
+ NUXT_PUBLIC_AUTH_PROVIDER_CLIENT_ID="your-client-id"
65
56
  ```
66
57
 
67
- Locally preview production build:
58
+ ### Production Environments
59
+ > [!IMPORTANT]
60
+ > The values for staging and production environments are managed securely and should not be stored in this file.
68
61
 
69
- ```bash
70
- pnpm preview
71
- ```
62
+ To obtain the correct values for a production build or deployment, please contact the Connect Platform Team.
72
63
 
73
- Checkout the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
64
+ ## Contributing
65
+ We welcome contributions to this package! Please see the main [Contribution Guidelines](../../../CONTRIBUTING.md) for information on our branching strategy, commit conventions, and pull request process.
@@ -5,8 +5,8 @@
5
5
  <h3 class="text-red-700">
6
6
  Auth - should be red-700
7
7
  </h3>
8
- <p class="text-bcGovColor-navDivider">
9
- Auth - should be bcGovColor-navDivider
8
+ <p class="text-brandLight">
9
+ Auth - should be brandLight
10
10
  </p>
11
11
  </div>
12
12
  </template>
package/nuxt.config.ts CHANGED
@@ -18,5 +18,13 @@ export default defineNuxtConfig({
18
18
 
19
19
  css: [
20
20
  resolve('./app/assets/css/tw-auth.css')
21
- ]
21
+ ],
22
+
23
+ runtimeConfig: {
24
+ public: {
25
+ // Should in alphabetical order
26
+ appName: process.env.npm_package_name || '',
27
+ version: `Connect Auth Layer v${process.env.npm_package_version || ''}`
28
+ }
29
+ }
22
30
  })
package/package.json CHANGED
@@ -1,24 +1,23 @@
1
1
  {
2
2
  "name": "@sbc-connect/nuxt-auth",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "repository": "github:bcgov/connect-nuxt",
6
+ "license": "BSD-3-Clause",
6
7
  "main": "./nuxt.config.ts",
7
8
  "devDependencies": {
8
9
  "@axe-core/playwright": "^4.10.2",
9
- "@nuxtjs/i18n": "^9.5.5",
10
- "@vitest/coverage-v8": "^3.2.3",
10
+ "@vitest/coverage-v8": "^3.2.4",
11
11
  "dotenv": "^17.2.0",
12
12
  "nuxt": "4.0.0",
13
13
  "typescript": "^5.8.3",
14
- "vue": "latest",
15
- "vue-tsc": "^3.0.2",
16
- "@sbc-connect/eslint-config": "0.0.3",
17
- "@sbc-connect/playwright-config": "0.0.3",
18
- "@sbc-connect/vitest-config": "0.0.3"
14
+ "vue-tsc": "^3.0.3",
15
+ "@sbc-connect/playwright-config": "0.0.4",
16
+ "@sbc-connect/vitest-config": "0.0.5",
17
+ "@sbc-connect/eslint-config": "0.0.5"
19
18
  },
20
19
  "dependencies": {
21
- "@sbc-connect/nuxt-base": "0.1.2"
20
+ "@sbc-connect/nuxt-base": "0.1.4"
22
21
  },
23
22
  "scripts": {
24
23
  "preinstall": "npx only-allow pnpm",
package/eslint.config.ts DELETED
@@ -1,3 +0,0 @@
1
- import eslintConfig from '@sbc-connect/eslint-config'
2
-
3
- export default eslintConfig