mirror of
https://github.com/makeplane/plane.git
synced 2025-12-22 22:59:33 +01:00
chore: added publicRuntimeConfig
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// cookies
|
||||
import getConfig from "next/config";
|
||||
import { convertCookieStringToObject } from "./cookie";
|
||||
// types
|
||||
import type { IProjectMember, IUser, IWorkspace, IWorkspaceMember } from "types";
|
||||
@@ -9,7 +10,9 @@ export const requiredAuth = async (cookie?: string) => {
|
||||
|
||||
if (!token) return null;
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const baseUrl = NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
|
||||
let user: IUser | null = null;
|
||||
|
||||
@@ -41,7 +44,9 @@ export const requiredAdmin = async (workspaceSlug: string, projectId: string, co
|
||||
const cookies = convertCookieStringToObject(cookie);
|
||||
const token = cookies?.accessToken;
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const baseUrl = NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
|
||||
let memberDetail: IProjectMember | null = null;
|
||||
|
||||
@@ -75,7 +80,9 @@ export const requiredWorkspaceAdmin = async (workspaceSlug: string, cookie?: str
|
||||
const cookies = convertCookieStringToObject(cookie);
|
||||
const token = cookies?.accessToken;
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const baseUrl = NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
|
||||
let memberDetail: IWorkspaceMember | null = null;
|
||||
|
||||
@@ -119,7 +126,8 @@ export const homePageRedirect = async (cookie?: string) => {
|
||||
|
||||
let workspaces: IWorkspace[] = [];
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
const baseUrl = NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
|
||||
const cookies = convertCookieStringToObject(cookie);
|
||||
const token = cookies?.accessToken;
|
||||
|
||||
Reference in New Issue
Block a user