mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Ready for 1.1.3-rc.3 release.
This commit is contained in:
@@ -4,14 +4,11 @@ import {createAuthClient} from "better-auth/react";
|
||||
import {adminClient, inferAdditionalFields, organizationClient} from "better-auth/client/plugins";
|
||||
import {ac, user, admin as adminRole, pending, superadmin, orgAdmin, orgMember, orgOwner} from "./permissions";
|
||||
import {auth} from "@/lib/auth/auth";
|
||||
import {getServerUrl} from "@/utils/get-server-url";
|
||||
|
||||
const baseURL =
|
||||
typeof window === "undefined"
|
||||
? process.env.PROJECT_URL // server side
|
||||
: "";
|
||||
|
||||
const res = await fetch(`${baseURL}/api/config`);
|
||||
const { PROJECT_URL } = await res.json();
|
||||
const res = await fetch(`${getServerUrl()}/api/config`);
|
||||
const {PROJECT_URL} = await res.json();
|
||||
console.log(PROJECT_URL);
|
||||
|
||||
export const authClient = createAuthClient({
|
||||
baseURL: PROJECT_URL,
|
||||
|
||||
@@ -5,7 +5,7 @@ export const getServerUrl = () => {
|
||||
return window.location.origin;
|
||||
}
|
||||
if (env.NODE_ENV === "development") {
|
||||
return `${env.NEXT_PUBLIC_PROJECT_URL}`;
|
||||
return `${env.PROJECT_URL}`;
|
||||
}
|
||||
return `${env.NEXT_PUBLIC_PROJECT_URL}`;
|
||||
return `${env.PROJECT_URL}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user