Skip to content

Commit

Permalink
podbox unit tests (#1902)
Browse files Browse the repository at this point in the history
  • Loading branch information
ichub authored Sep 26, 2024
1 parent 0ac1827 commit bcd3a43
Show file tree
Hide file tree
Showing 2 changed files with 561 additions and 1 deletion.
5 changes: 5 additions & 0 deletions apps/passport-server/src/database/queries/pipelineUserDB.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { normalizeEmail } from "@pcd/util";
import { validate } from "email-validator";
import { Pool, PoolClient } from "postgres-pool";
import { v4 as uuid } from "uuid";
import { traceUser } from "../../services/generic-issuance/honeycombQueries";
Expand Down Expand Up @@ -56,6 +57,10 @@ export class PipelineUserDB implements IPipelineUserDB {
this.db,
"createOrGetUser",
async (client): Promise<PipelineUser> => {
if (!validate(email)) {
throw new Error(`Invalid email: ${email}`);
}

span?.setAttribute("email", email);
const existingUser = await this.getUserByEmail(email, client);
if (existingUser) {
Expand Down
Loading

0 comments on commit bcd3a43

Please sign in to comment.