mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-10 14:05:18 +00:00
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:
@@ -42,7 +42,7 @@ const { handler, api } = betterAuth({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (admin) {
|
if (admin?.user) {
|
||||||
return [
|
return [
|
||||||
...(admin.user.serverIp
|
...(admin.user.serverIp
|
||||||
? [`http://${admin.user.serverIp}:3000`]
|
? [`http://${admin.user.serverIp}:3000`]
|
||||||
|
|||||||
Reference in New Issue
Block a user