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.
This commit is contained in:
Mauricio Siu
2025-12-15 00:23:43 -06:00
parent 72cc7a2d2c
commit 67f4ca2cd9

View File

@@ -42,7 +42,7 @@ const { handler, api } = betterAuth({
},
});
if (admin) {
if (admin?.user) {
return [
...(admin.user.serverIp
? [`http://${admin.user.serverIp}:3000`]