File size: 377 Bytes
b954b26 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
export async function GET({ locals }) {
if (locals.user) {
const res = {
id: locals.user._id,
username: locals.user.username,
name: locals.user.name,
email: locals.user.email,
avatarUrl: locals.user.avatarUrl,
hfUserId: locals.user.hfUserId,
};
return Response.json(res);
}
return Response.json({ message: "Must be signed in" }, { status: 401 });
}
|