@zitadel/sdk-nuxt 1.0.0-alpha.20 → 1.0.0-alpha.21

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/README.md CHANGED
@@ -71,7 +71,7 @@ const auth = useAuth();
71
71
  </script>
72
72
 
73
73
  <template>
74
- <p>{{ auth.isAuthenticated ? auth.session.email : 'Not signed in' }}</p>
74
+ <p>{{ auth.isAuthenticated ? (auth.session.display ?? auth.session.identifier) : 'Not signed in' }}</p>
75
75
  </template>
76
76
  ```
77
77
 
@@ -153,7 +153,12 @@ async function validateOpaqueSessionToken(token, issuerUrl, timeoutMs) {
153
153
  });
154
154
  if (!res.ok) return null;
155
155
  const body = await res.json();
156
- return { userId: body.user_id };
156
+ return {
157
+ userId: body.user_id,
158
+ identifier: body.user?.identifier ?? null,
159
+ identifierProperty: body.user?.identifier_property ?? null,
160
+ display: body.user?.display ?? null
161
+ };
157
162
  } catch {
158
163
  return null;
159
164
  }
@@ -189,8 +194,9 @@ async function handleAuth(event, opts) {
189
194
  isAuthenticated: true,
190
195
  session: {
191
196
  userId: payload.sub,
192
- email: payload.email ?? null,
193
- name: payload.name ?? null,
197
+ identifier: payload.email ?? null,
198
+ identifierProperty: null,
199
+ display: payload.name ?? null,
194
200
  token
195
201
  }
196
202
  };
@@ -204,8 +210,9 @@ async function handleAuth(event, opts) {
204
210
  isAuthenticated: true,
205
211
  session: {
206
212
  userId: opaqueResult.userId,
207
- email: null,
208
- name: null,
213
+ identifier: opaqueResult.identifier,
214
+ identifierProperty: opaqueResult.identifierProperty,
215
+ display: opaqueResult.display,
209
216
  token: cookieToken
210
217
  }
211
218
  };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import "./chunk-ZNXAFGLP.js";
2
2
  import {
3
3
  createNextgenMiddleware,
4
4
  getAuth
5
- } from "./chunk-MJ3RLEU6.js";
5
+ } from "./chunk-GQKD27DF.js";
6
6
 
7
7
  // src/index.ts
8
8
  import { ZitadelLogin, ZitadelLogout } from "@zitadel/components";
@@ -11,8 +11,9 @@ var plugin_default = defineNuxtPlugin(() => {
11
11
  isAuthenticated: true,
12
12
  session: {
13
13
  userId: auth.session.userId,
14
- email: auth.session.email,
15
- name: auth.session.name
14
+ identifier: auth.session.identifier,
15
+ identifierProperty: auth.session.identifierProperty,
16
+ display: auth.session.display
16
17
  }
17
18
  } : { isAuthenticated: false, session: null };
18
19
  useState("nextgen-auth", () => clientAuth);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createNextgenMiddleware
3
- } from "../../chunk-MJ3RLEU6.js";
3
+ } from "../../chunk-GQKD27DF.js";
4
4
 
5
5
  // src/runtime/server/handler.ts
6
6
  import { useRuntimeConfig } from "#imports";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createNextgenMiddleware,
3
3
  getAuth
4
- } from "../../chunk-MJ3RLEU6.js";
4
+ } from "../../chunk-GQKD27DF.js";
5
5
  export {
6
6
  createNextgenMiddleware,
7
7
  getAuth
package/dist/server.js CHANGED
@@ -2,7 +2,7 @@ import "./chunk-ZNXAFGLP.js";
2
2
  import {
3
3
  createNextgenMiddleware,
4
4
  getAuth
5
- } from "./chunk-MJ3RLEU6.js";
5
+ } from "./chunk-GQKD27DF.js";
6
6
  export {
7
7
  createNextgenMiddleware,
8
8
  getAuth
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zitadel/sdk-nuxt",
3
- "version": "1.0.0-alpha.20",
3
+ "version": "1.0.0-alpha.21",
4
4
  "description": "Nuxt proxy middleware and helpers for the pre-release Zitadel preview.",
5
5
  "homepage": "https://github.com/zitadel/nextgen/tree/main/packages/sdk-nuxt#readme",
6
6
  "bugs": {
@@ -33,9 +33,9 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@zitadel/components": "1.0.0-alpha.20",
37
- "@zitadel/sdk-core": "1.0.0-alpha.20",
38
- "@zitadel/api": "1.0.0-alpha.20"
36
+ "@zitadel/api": "1.0.0-alpha.21",
37
+ "@zitadel/sdk-core": "1.0.0-alpha.21",
38
+ "@zitadel/components": "1.0.0-alpha.21"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "h3": ">=1",