Skip to content

Commit 93d8dd0

Browse files
committed
Fix some errors preventing building
1 parent c20fcae commit 93d8dd0

File tree

4 files changed

+34
-22
lines changed

4 files changed

+34
-22
lines changed

package-lock.json

Lines changed: 25 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@radix-ui/react-icons": "^1.3.0",
1616
"@radix-ui/themes": "^3.0.1",
17-
"@workos-inc/authkit-nextjs": "^0.11.0",
17+
"@workos-inc/authkit-nextjs": "^0.11.1",
1818
"next": "^14.2.5",
1919
"react": "^18",
2020
"react-dom": "^18"

src/app/account/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ export default async function AccountPage() {
2727
{userFields && (
2828
<Flex direction="column" justify="center" gap="3" width="400px">
2929
{userFields.map(([label, value]) => (
30-
<Flex asChild align="center" gap="6" key={value}>
30+
<Flex asChild align="center" gap="6" key={String(value)}>
3131
<label>
3232
<Text weight="bold" size="3" style={{ width: 100 }}>
3333
{label}
3434
</Text>
3535

3636
<Box flexGrow="1">
37-
<TextField.Root value={value || ""} readOnly />
37+
<TextField.Root value={String(value) || ""} readOnly />
3838
</Box>
3939
</label>
4040
</Flex>

src/app/api/get-name/route.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { NextResponse } from "next/server";
33

44
export const GET = async () => {
55
// Use 'getSession' for edge functions that don't have access to headers
6-
const { user } = await getSession();
6+
const session = await getSession();
77

8-
return NextResponse.json({ name: user.firstName });
8+
if (!session || !session.user) {
9+
return NextResponse.json({ error: "User not found" }, { status: 404 });
10+
}
11+
12+
return NextResponse.json({ name: session.user.firstName });
913
};

0 commit comments

Comments
 (0)