@~lyre/auth 0.0.4 → 0.0.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.
@@ -196,13 +196,16 @@ function parseAuthorizationState(value) {
196
196
  }
197
197
  }
198
198
  function normalizeIdentity(user) {
199
+ const firstName = user.firstName ?? user.first_name;
200
+ const lastName = user.lastName ?? user.last_name;
199
201
  return {
200
202
  id: user.id,
201
- email: user.email ?? `${user.id}@accounts.local`,
202
- name: user.name ?? ([user.first_name, user.last_name].filter(Boolean).join(" ") || "Accounts User"),
203
- firstName: user.first_name,
204
- lastName: user.last_name,
205
- avatarUrl: user.avatar_url
203
+ // Prefer the real address under either key; only synthesize when truly absent.
204
+ email: user.emailAddress ?? user.email ?? `${user.id}@accounts.local`,
205
+ name: user.name ?? ([firstName, lastName].filter(Boolean).join(" ") || "Accounts User"),
206
+ firstName,
207
+ lastName,
208
+ avatarUrl: user.avatarUrl ?? user.avatar_url
206
209
  };
207
210
  }
208
211
  function createMockTokenResponse(code) {
package/dist/index.d.ts CHANGED
@@ -69,10 +69,14 @@ type AccountsTokenResponse = {
69
69
  user: {
70
70
  id: string;
71
71
  email?: string;
72
+ emailAddress?: string;
72
73
  name?: string;
73
74
  first_name?: string;
75
+ firstName?: string;
74
76
  last_name?: string;
77
+ lastName?: string;
75
78
  avatar_url?: string;
79
+ avatarUrl?: string;
76
80
  };
77
81
  };
78
82
  type SyncAccountsUserResult = {
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  readPlatformSessionCookie,
10
10
  resolveActiveTenant,
11
11
  syncAccountsUser
12
- } from "./chunk-R3JOX2XR.js";
12
+ } from "./chunk-LMIRQKLN.js";
13
13
  export {
14
14
  beginAccountsLoginRedirect,
15
15
  clearPlatformSessionCookie,
package/dist/sveltekit.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  handleAccountsCallback,
5
5
  identityPassthroughSync,
6
6
  readPlatformSessionCookie
7
- } from "./chunk-R3JOX2XR.js";
7
+ } from "./chunk-LMIRQKLN.js";
8
8
 
9
9
  // src/sveltekit.ts
10
10
  import { redirect } from "@sveltejs/kit";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@~lyre/auth",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Shared Axis Accounts auth SDK — framework-agnostic session/identity core (HMAC-signed cookies, accounts login/callback/logout) plus an optional turnkey SvelteKit adapter.",
5
5
  "type": "module",
6
6
  "sideEffects": false,