fix: resolve field naming inconsistency in account listing endpoint (#4175)

This commit is contained in:
KinfeMichael Tariku
2025-08-29 10:59:12 -07:00
committed by GitHub
parent 40a412428d
commit cccf87f494
2 changed files with 21 additions and 21 deletions
@@ -349,9 +349,9 @@ describe("account", async () => {
const accountToUnlink = previousAccounts.data![0];
const unlinkAccountId = accountToUnlink.accountId;
const providerId = accountToUnlink.provider;
const providerId = accountToUnlink.providerId;
const accountsWithSameProvider = previousAccounts.data!.filter(
(account) => account.provider === providerId,
(account) => account.providerId === providerId,
);
if (accountsWithSameProvider.length <= 1) {
return;
@@ -412,7 +412,7 @@ describe("account", async () => {
});
const googleAccounts = previousAccounts.data!.filter(
(account) => account.provider === "google",
(account) => account.providerId === "google",
);
expect(googleAccounts.length).toBeGreaterThan(1);
@@ -434,7 +434,7 @@ describe("account", async () => {
});
const remainingGoogleAccounts = accountsAfterUnlink.data!.filter(
(account) => account.provider === "google",
(account) => account.providerId === "google",
);
expect(remainingGoogleAccounts.length).toBe(1);
});
+17 -17
View File
@@ -36,7 +36,7 @@ export const listUserAccounts = createAuthEndpoint(
id: {
type: "string",
},
provider: {
providerId: {
type: "string",
},
createdAt: {
@@ -47,25 +47,25 @@ export const listUserAccounts = createAuthEndpoint(
type: "string",
format: "date-time",
},
},
accountId: {
type: "string",
},
scopes: {
type: "array",
items: {
accountId: {
type: "string",
},
scopes: {
type: "array",
items: {
type: "string",
},
},
},
required: [
"id",
"providerId",
"createdAt",
"updatedAt",
"accountId",
"scopes",
],
},
required: [
"id",
"provider",
"createdAt",
"updatedAt",
"accountId",
"scopes",
],
},
},
},
@@ -82,7 +82,7 @@ export const listUserAccounts = createAuthEndpoint(
return c.json(
accounts.map((a) => ({
id: a.id,
provider: a.providerId,
providerId: a.providerId,
createdAt: a.createdAt,
updatedAt: a.updatedAt,
accountId: a.accountId,