@sbc-connect/nuxt-auth 0.1.3 → 0.1.5
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 +21 -0
- package/README.md +38 -46
- package/app/components/HelloWorld/Auth.vue +2 -2
- package/nuxt.config.ts +9 -1
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @sbc-connect/nuxt-auth
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`4231254`](https://github.com/bcgov/connect-nuxt/commit/42312540f5eec65f5d3979d5492bdfaa9bb0b079)]:
|
|
8
|
+
- @sbc-connect/nuxt-base@0.1.5
|
|
9
|
+
|
|
10
|
+
## 0.1.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#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)
|
|
15
|
+
|
|
16
|
+
- add footer component
|
|
17
|
+
- appendUrlParam util
|
|
18
|
+
|
|
19
|
+
issue: bcgov/entity#29334
|
|
20
|
+
|
|
21
|
+
- 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)]:
|
|
22
|
+
- @sbc-connect/nuxt-base@0.1.4
|
|
23
|
+
|
|
3
24
|
## 0.1.3
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,73 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
[](LICENSE) [](https://pkg.pr.new/~/bcgov/connect-nuxt)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# @sbc-connect/nuxt-auth
|
|
4
|
+
A Nuxt layer for handling user authentication and session management within the Connect ecosystem.
|
|
4
5
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
19
|
+
For detailed usage and documentation, please see the [Auth Layer Docs](../../../docs/packages/layers/auth/intro.md).
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Usage
|
|
22
22
|
|
|
23
|
-
|
|
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
|
-
|
|
26
|
+
pnpm install @sbc-connect/nuxt-auth
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
|
|
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
|
-
|
|
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: '
|
|
37
|
+
extends: '@sbc-connect/nuxt-auth'
|
|
42
38
|
})
|
|
43
39
|
```
|
|
44
40
|
|
|
45
|
-
##
|
|
41
|
+
## Environment Variables
|
|
42
|
+
This project requires certain environment variables to be set to run correctly.
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
Create a file named .env in the root of the project.
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
pnpm dev
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Production
|
|
46
|
+
Copy the contents of the .env.example file into your new .env file.
|
|
54
47
|
|
|
55
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
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,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbc-connect/nuxt-auth",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
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
|
-
"@vitest/coverage-v8": "^3.2.
|
|
10
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
10
11
|
"dotenv": "^17.2.0",
|
|
11
|
-
"nuxt": "4.0.0",
|
|
12
|
+
"nuxt": "^4.0.0",
|
|
12
13
|
"typescript": "^5.8.3",
|
|
13
|
-
"vue-tsc": "^3.0.
|
|
14
|
-
"@sbc-connect/eslint-config": "0.0.
|
|
14
|
+
"vue-tsc": "^3.0.3",
|
|
15
|
+
"@sbc-connect/eslint-config": "0.0.5",
|
|
15
16
|
"@sbc-connect/playwright-config": "0.0.4",
|
|
16
|
-
"@sbc-connect/vitest-config": "0.0.
|
|
17
|
+
"@sbc-connect/vitest-config": "0.0.5"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@sbc-connect/nuxt-base": "0.1.
|
|
20
|
+
"@sbc-connect/nuxt-base": "0.1.5"
|
|
20
21
|
},
|
|
21
22
|
"scripts": {
|
|
22
23
|
"preinstall": "npx only-allow pnpm",
|