@meistrari/auth-nuxt 3.4.1 → 3.4.2

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/auth-nuxt",
3
3
  "configKey": "telaAuth",
4
- "version": "3.4.1",
4
+ "version": "3.4.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -6,10 +6,14 @@ import type { FullOrganization, User } from '@meistrari/auth-core';
6
6
  * Provides methods to:
7
7
  * - Initiate OAuth login flow with PKCE
8
8
  * - Exchange authorization codes for tokens
9
- * - Automatically refresh access tokens
10
9
  * - Manage user session state
11
10
  * - Handle logout
12
11
  *
12
+ * Session restoration and background token refresh are handled automatically
13
+ * by the SDK's Nuxt plugin — consumers do not need to call any "init" function
14
+ * on app startup or after the OAuth callback. Just read `user` / `activeOrganization`
15
+ * from the returned state.
16
+ *
13
17
  * @returns An object containing authentication state and methods
14
18
  * @throws {Error} If auth dashboard URL is not configured
15
19
  *
@@ -18,15 +22,9 @@ import type { FullOrganization, User } from '@meistrari/auth-core';
18
22
  * const auth = useTelaApplicationAuth()
19
23
  *
20
24
  * // Initiate login
21
- * await auth.login({
22
- * applicationId: 'app-123',
23
- * redirectUri: 'https://example.com/callback'
24
- * })
25
- *
26
- * // Initialize session (handles OAuth callback and token refresh)
27
- * await auth.initSession()
25
+ * await auth.login()
28
26
  *
29
- * // Access user state
27
+ * // Access user state (hydrated automatically by the SDK plugin)
30
28
  * console.log(auth.user.value)
31
29
  * console.log(auth.activeOrganization.value)
32
30
  *
@@ -104,6 +104,13 @@ export function useTelaApplicationAuth() {
104
104
  ...state,
105
105
  login,
106
106
  logout,
107
+ /**
108
+ * @deprecated The SDK's Nuxt plugin handles session restoration and background
109
+ * token refresh automatically. On app startup it hydrates `user` and
110
+ * `activeOrganization` via `/auth/whoami` (client) or `whoAmI` (server) and
111
+ * schedules refreshes ahead of access-token expiry. Calling this function
112
+ * is redundant in normal usage and will be removed in a future release.
113
+ */
107
114
  initSession,
108
115
  getAvailableOrganizations,
109
116
  switchOrganization,
package/package.json CHANGED
@@ -1,63 +1,63 @@
1
1
  {
2
- "name": "@meistrari/auth-nuxt",
3
- "version": "3.4.1",
4
- "type": "module",
5
- "exports": {
6
- ".": {
7
- "types": "./dist/types.d.mts",
8
- "import": "./dist/module.mjs"
9
- },
10
- "./server/middleware/auth": {
11
- "types": "./dist/runtime/server/middleware/auth.d.ts",
12
- "import": "./dist/runtime/server/middleware/auth.js"
13
- },
14
- "./server/middleware/application-auth": {
15
- "types": "./dist/runtime/server/middleware/application-auth.d.ts",
16
- "import": "./dist/runtime/server/middleware/application-auth.js"
17
- },
18
- "./core": {
19
- "types": "./dist/core.d.mts",
20
- "import": "./dist/core.mjs"
21
- }
2
+ "name": "@meistrari/auth-nuxt",
3
+ "version": "3.4.2",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/types.d.mts",
8
+ "import": "./dist/module.mjs"
22
9
  },
23
- "main": "./dist/module.mjs",
24
- "typesVersions": {
25
- "*": {
26
- ".": [
27
- "./dist/types.d.mts"
28
- ]
29
- }
10
+ "./server/middleware/auth": {
11
+ "types": "./dist/runtime/server/middleware/auth.d.ts",
12
+ "import": "./dist/runtime/server/middleware/auth.js"
30
13
  },
31
- "files": [
32
- "dist"
33
- ],
34
- "scripts": {
35
- "build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build",
36
- "docs": "nuxt-module-build prepare && typedoc"
14
+ "./server/middleware/application-auth": {
15
+ "types": "./dist/runtime/server/middleware/application-auth.d.ts",
16
+ "import": "./dist/runtime/server/middleware/application-auth.js"
37
17
  },
38
- "dependencies": {
39
- "@meistrari/auth-core": "1.16.0",
40
- "jose": "6.1.3"
41
- },
42
- "peerDependencies": {
43
- "nuxt": "^3.0.0 || ^4.0.0",
44
- "vue": "^3.0.0"
45
- },
46
- "devDependencies": {
47
- "@nuxt/devtools": "2.6.3",
48
- "@nuxt/eslint-config": "1.9.0",
49
- "@nuxt/kit": "4.0.3",
50
- "@nuxt/module-builder": "1.0.2",
51
- "@nuxt/schema": "4.0.3",
52
- "@nuxt/test-utils": "3.19.2",
53
- "@types/node": "latest",
54
- "changelogen": "0.6.2",
55
- "nuxt": "4.0.3",
56
- "typescript": "5.9.2",
57
- "unbuild": "3.6.1",
58
- "typedoc": "0.28.18",
59
- "typedoc-plugin-markdown": "4.11.0",
60
- "vitest": "3.2.4",
61
- "vue-tsc": "3.0.6"
18
+ "./core": {
19
+ "types": "./dist/core.d.mts",
20
+ "import": "./dist/core.mjs"
21
+ }
22
+ },
23
+ "main": "./dist/module.mjs",
24
+ "typesVersions": {
25
+ "*": {
26
+ ".": [
27
+ "./dist/types.d.mts"
28
+ ]
62
29
  }
30
+ },
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "scripts": {
35
+ "build": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt-module-build build",
36
+ "docs": "nuxt-module-build prepare && typedoc"
37
+ },
38
+ "dependencies": {
39
+ "@meistrari/auth-core": "1.16.0",
40
+ "jose": "6.1.3"
41
+ },
42
+ "peerDependencies": {
43
+ "nuxt": "^3.0.0 || ^4.0.0",
44
+ "vue": "^3.0.0"
45
+ },
46
+ "devDependencies": {
47
+ "@nuxt/devtools": "2.6.3",
48
+ "@nuxt/eslint-config": "1.9.0",
49
+ "@nuxt/kit": "4.0.3",
50
+ "@nuxt/module-builder": "1.0.2",
51
+ "@nuxt/schema": "4.0.3",
52
+ "@nuxt/test-utils": "3.19.2",
53
+ "@types/node": "latest",
54
+ "changelogen": "0.6.2",
55
+ "nuxt": "4.0.3",
56
+ "typescript": "5.9.2",
57
+ "unbuild": "3.6.1",
58
+ "typedoc": "0.28.18",
59
+ "typedoc-plugin-markdown": "4.11.0",
60
+ "vitest": "3.2.4",
61
+ "vue-tsc": "3.0.6"
62
+ }
63
63
  }