From 397bb9f9e0d49cba3b87461f7c2074cbf85a4cb7 Mon Sep 17 00:00:00 2001 From: ZZwatermelon <63483612+ZZwatermelon@users.noreply.github.com> Date: Wed, 11 Feb 2026 15:02:50 -0500 Subject: [PATCH] Split the email into the username --- server/src/api/devices/cards/cardApi.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/api/devices/cards/cardApi.ts b/server/src/api/devices/cards/cardApi.ts index 6ed977e1..ebb5c608 100644 --- a/server/src/api/devices/cards/cardApi.ts +++ b/server/src/api/devices/cards/cardApi.ts @@ -28,10 +28,11 @@ export function registerEndpoints(app: express.Application) { if (typeof universityID !== "string") { return res.status(400).json({ error: "universityID was not a string" }).send(); } if (typeof cardTag !== "string") { return res.status(400).json({ error: "cardTag was not a string" }).send(); } - const username = await Atrium.getRitEmailByUID(CurrencySource.Store, universityID); - if (username === undefined) { + const email = await Atrium.getRitEmailByUID(CurrencySource.Store, universityID); + if (email === undefined) { return res.status(404).json({ error: "No user found with the given universityID" }).send(); } + const username = email.split("@")[0]; const user = await UserRepo.getUserByRitUsername(username); if (user === undefined) {