mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
return full user object for /auth/me
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import type { UserRecord } from "@issue/shared";
|
||||||
import type { AuthedRequest } from "../../auth/middleware";
|
import type { AuthedRequest } from "../../auth/middleware";
|
||||||
import { getUserById } from "../../db/queries";
|
import { getUserById } from "../../db/queries";
|
||||||
|
|
||||||
@@ -7,5 +8,5 @@ export default async function me(req: AuthedRequest) {
|
|||||||
return new Response("user not found", { status: 404 });
|
return new Response("user not found", { status: 404 });
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response.json({ id: user.id, name: user.name, username: user.username });
|
return Response.json(user as UserRecord);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user