Skip to content

Commit 67f4ca2

Browse files
committed
fix(auth): update admin check to safely access user property
- Modified the admin check to use optional chaining, ensuring that the user property is accessed only if it exists, preventing potential runtime errors.
1 parent 72cc7a2 commit 67f4ca2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/server/src/lib/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const { handler, api } = betterAuth({
4242
},
4343
});
4444

45-
if (admin) {
45+
if (admin?.user) {
4646
return [
4747
...(admin.user.serverIp
4848
? [`http://${admin.user.serverIp}:3000`]

0 commit comments

Comments
 (0)