Update src/auth/src/routes/whoami.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Maix0 2025-08-31 16:36:25 +02:00
parent a6ce4630f5
commit 238dead666

View file

@ -16,8 +16,7 @@ const route: FastifyPluginAsync = async (fastify, _opts): Promise<void> => {
"/api/auth/whoami", "/api/auth/whoami",
{ schema: { response: { "2xx": WhoAmIRes } }, config: { requireAuth: true } }, { schema: { response: { "2xx": WhoAmIRes } }, config: { requireAuth: true } },
async function(req, _res) { async function(req, _res) {
if (isNullish(req.authUser)) return makeResponse("failure", "whoami.failure.generic")
return makeResponse("success", "whoami.failure.generic")
return makeResponse("success", "whoami.success", { name: req.authUser.name }) return makeResponse("success", "whoami.success", { name: req.authUser.name })
}, },
); );