diff --git a/server/test/api/auth.test.ts b/server/test/api/auth.test.ts index 4d7b8208bf..907645ffaa 100644 --- a/server/test/api/auth.test.ts +++ b/server/test/api/auth.test.ts @@ -437,7 +437,13 @@ describe("authentication", () => { expect(customer).toHaveBeenCalledWith( expect.objectContaining({ flow: { name: "signup", type: "signup" }, - customer: { id, tags: [{ name: "source", value: "12345", type: "string" }] }, + customer: { + id, + tags: [ + { name: "source", value: "12345", type: "string" }, + { name: "auth_method", value: "siwe", type: "string" }, + ], + }, }), ); @@ -463,7 +469,13 @@ describe("authentication", () => { expect(customer).toHaveBeenCalledWith( expect.objectContaining({ flow: { name: "signup", type: "signup" }, - customer: { id, tags: [{ name: "source", value: "EXA", type: "string" }] }, + customer: { + id, + tags: [ + { name: "source", value: "EXA", type: "string" }, + { name: "auth_method", value: "siwe", type: "string" }, + ], + }, }), ); @@ -704,7 +716,13 @@ describe("registration", () => { expect(customer).toHaveBeenCalledWith( expect.objectContaining({ flow: { name: "signup", type: "signup" }, - customer: { id, tags: [{ name: "source", value: "EXA", type: "string" }] }, + customer: { + id, + tags: [ + { name: "source", value: "EXA", type: "string" }, + { name: "auth_method", value: "siwe", type: "string" }, + ], + }, }), ); @@ -775,7 +793,13 @@ describe("registration", () => { expect(customer).toHaveBeenCalledWith( expect.objectContaining({ flow: { name: "signup", type: "signup" }, - customer: { id: "dGVzdC1jcmVkLWlk2", tags: [{ name: "source", value: "12345", type: "string" }] }, + customer: { + id: "dGVzdC1jcmVkLWlk2", + tags: [ + { name: "source", value: "12345", type: "string" }, + { name: "auth_method", value: "webauthn", type: "string" }, + ], + }, }), ); @@ -850,7 +874,13 @@ describe("registration", () => { expect(customer).toHaveBeenCalledWith( expect.objectContaining({ flow: { name: "signup", type: "signup" }, - customer: { id: "YW5vdGhlci1jcmVkLWlk2", tags: [{ name: "source", value: "EXA", type: "string" }] }, + customer: { + id: "YW5vdGhlci1jcmVkLWlk2", + tags: [ + { name: "source", value: "EXA", type: "string" }, + { name: "auth_method", value: "webauthn", type: "string" }, + ], + }, }), ); const credential = await database.query.credentials.findFirst({ diff --git a/server/utils/createCredential.ts b/server/utils/createCredential.ts index 89540a50c2..c1a7a8a283 100644 --- a/server/utils/createCredential.ts +++ b/server/utils/createCredential.ts @@ -60,7 +60,10 @@ export default async function createCredential( flow: { name: "signup", type: "signup" }, customer: { id: credentialId, - tags: [{ name: "source", value: options?.source ?? "EXA", type: "string" }], + tags: [ + { name: "source", value: options?.source ?? "EXA", type: "string" }, + { name: "auth_method", value: isAddress(credentialId) ? "siwe" : "webauthn", type: "string" }, + ], }, }).catch((error: unknown) => captureException(error, { level: "error" })), ]);