diff --git a/src/utils/appwriteServer.util.ts b/src/utils/appwriteServer.util.ts index bd68edf2..dfea00b8 100644 --- a/src/utils/appwriteServer.util.ts +++ b/src/utils/appwriteServer.util.ts @@ -7,7 +7,9 @@ client .setEndpoint( (process.env["NEXT_PUBLIC_APPWRITE_HOST"] as string).replace( "localhost", - "host.docker.internal" + process.env.NODE_ENV == "production" + ? "host.docker.internal" + : "localhost" ) ) .setProject("pingvin-share") diff --git a/src/utils/shares/security.util.ts b/src/utils/shares/security.util.ts index 4161af02..8be71059 100644 --- a/src/utils/shares/security.util.ts +++ b/src/utils/shares/security.util.ts @@ -19,7 +19,7 @@ export const checkSecurity = async ( .getDocument("shareSecurity", shareDocument.securityID) .then((securityDocument) => { if (securityDocument.maxVisitors) { - if (shareDocument.visitorCount > securityDocument.maxVisitors) { + if (shareDocument.visitorCount >= securityDocument.maxVisitors) { throw "visitor_limit_exceeded"; } }