fix: add missing typings to create provider identity (#8677)
* fix: add missing typings to create provider identity * add app_metadata to filterable fields for auth identity
This commit is contained in:
@@ -189,4 +189,6 @@ export interface FilterableAuthIdentityProps
|
||||
*/
|
||||
provider?: string
|
||||
}
|
||||
|
||||
app_metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@ export async function createAuthIdentities(
|
||||
provider: "manual",
|
||||
},
|
||||
],
|
||||
app_metadata: {
|
||||
user_id: "user-1",
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "test-id-1",
|
||||
|
||||
+17
-1
@@ -67,6 +67,20 @@ moduleIntegrationTestRunner<IAuthModuleService>({
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
it("should list authIdentities by meta data", async () => {
|
||||
const authIdentities = await service.listAuthIdentities({
|
||||
app_metadata: {
|
||||
user_id: "user-1",
|
||||
},
|
||||
})
|
||||
|
||||
expect(authIdentities).toEqual([
|
||||
expect.objectContaining({
|
||||
id: "test-id",
|
||||
}),
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe("listAndCountAuthIdentities", () => {
|
||||
@@ -226,7 +240,9 @@ moduleIntegrationTestRunner<IAuthModuleService>({
|
||||
const [authIdentity] = await service.listAuthIdentities({ id: [id] })
|
||||
expect(authIdentity).toEqual(
|
||||
expect.objectContaining({
|
||||
app_metadata: { email: "test@email.com" },
|
||||
app_metadata: expect.objectContaining({
|
||||
email: "test@email.com",
|
||||
}),
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
@@ -145,10 +145,8 @@ export default class AuthModuleService
|
||||
)
|
||||
|
||||
return await this.baseRepository_.serialize<
|
||||
AuthTypes.ProviderIdentityDTO[]
|
||||
>(providerIdentities, {
|
||||
populate: true,
|
||||
})
|
||||
AuthTypes.ProviderIdentityDTO | AuthTypes.ProviderIdentityDTO[]
|
||||
>(providerIdentities)
|
||||
}
|
||||
|
||||
async authenticate(
|
||||
|
||||
Reference in New Issue
Block a user