@~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
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
package/dist/sveltekit.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@~lyre/auth",
|
|
3
|
-
"version": "0.0.
|
|
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,
|