@sandbox0/dashboard-core 0.1.3-rc.2 → 0.1.3-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandbox0/dashboard-core",
3
- "version": "0.1.3-rc.2",
3
+ "version": "0.1.3-rc.4",
4
4
  "description": "Shared Sandbox0 dashboard auth and control-plane core",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/src/auth.ts CHANGED
@@ -10,6 +10,8 @@ interface LoginResponse {
10
10
  expires_at: number;
11
11
  }
12
12
 
13
+ const dashboardHomePath = "/";
14
+
13
15
  export const dashboardAccessTokenCookieName = "sandbox0_access_token";
14
16
  export const dashboardRefreshTokenCookieName = "sandbox0_refresh_token";
15
17
 
@@ -237,7 +239,7 @@ export async function resolveOIDCLoginLocation(
237
239
  const response = await fetchImpl(
238
240
  joinURL(
239
241
  baseURL,
240
- `/auth/oidc/${encodeURIComponent(providerID)}/login?return_url=${encodeURIComponent(config.dashboardBasePath)}`,
242
+ `/auth/oidc/${encodeURIComponent(providerID)}/login?return_url=${encodeURIComponent(dashboardHomePath)}`,
241
243
  ),
242
244
  {
243
245
  method: "GET",
@@ -310,14 +312,14 @@ export function setDashboardAuthCookies(
310
312
  httpOnly: true,
311
313
  sameSite: "lax",
312
314
  secure,
313
- path: config.dashboardBasePath,
315
+ path: dashboardHomePath,
314
316
  maxAge,
315
317
  });
316
318
  response.cookies.set(dashboardRefreshTokenCookieName, tokens.refresh_token, {
317
319
  httpOnly: true,
318
320
  sameSite: "lax",
319
321
  secure,
320
- path: config.dashboardBasePath,
322
+ path: dashboardHomePath,
321
323
  });
322
324
  }
323
325
 
@@ -331,14 +333,14 @@ export function clearDashboardAuthCookies(
331
333
  httpOnly: true,
332
334
  sameSite: "lax",
333
335
  secure,
334
- path: config.dashboardBasePath,
336
+ path: dashboardHomePath,
335
337
  maxAge: 0,
336
338
  });
337
339
  response.cookies.set(dashboardRefreshTokenCookieName, "", {
338
340
  httpOnly: true,
339
341
  sameSite: "lax",
340
342
  secure,
341
- path: config.dashboardBasePath,
343
+ path: dashboardHomePath,
342
344
  maxAge: 0,
343
345
  });
344
346
  }
package/src/config.ts CHANGED
@@ -3,8 +3,6 @@ import type {
3
3
  DashboardRuntimeConfig,
4
4
  } from "./types";
5
5
 
6
- const defaultDashboardBasePath = "/dashboard";
7
-
8
6
  function normalizeMode(value: string | undefined): DashboardControlPlaneMode {
9
7
  if (value === "global-directory") {
10
8
  return value;
@@ -29,7 +27,6 @@ export function resolveDashboardRuntimeConfig(
29
27
  if (mode === "global-directory") {
30
28
  return {
31
29
  mode,
32
- dashboardBasePath: defaultDashboardBasePath,
33
30
  siteURL,
34
31
  globalDirectoryURL:
35
32
  env.SANDBOX0_DASHBOARD_GLOBAL_DIRECTORY_URL ??
@@ -40,7 +37,6 @@ export function resolveDashboardRuntimeConfig(
40
37
 
41
38
  return {
42
39
  mode,
43
- dashboardBasePath: defaultDashboardBasePath,
44
40
  siteURL,
45
41
  singleClusterURL:
46
42
  env.SANDBOX0_DASHBOARD_SINGLE_CLUSTER_URL ??
package/src/session.ts CHANGED
@@ -141,7 +141,6 @@ export async function resolveDashboardSession(
141
141
  const baseSession: DashboardSession = {
142
142
  authenticated: false,
143
143
  mode: config.mode,
144
- dashboardBasePath: config.dashboardBasePath,
145
144
  siteURL: config.siteURL,
146
145
  configuredGlobalURL: config.globalDirectoryURL,
147
146
  configuredRegionalURL:
package/src/types.ts CHANGED
@@ -2,7 +2,6 @@ export type DashboardControlPlaneMode = "single-cluster" | "global-directory";
2
2
 
3
3
  export interface DashboardRuntimeConfig {
4
4
  mode: DashboardControlPlaneMode;
5
- dashboardBasePath: string;
6
5
  siteURL: string;
7
6
  singleClusterURL?: string;
8
7
  globalDirectoryURL?: string;
@@ -62,7 +61,6 @@ export interface DashboardTemplateSummary {
62
61
  export interface DashboardSession {
63
62
  authenticated: boolean;
64
63
  mode: DashboardControlPlaneMode;
65
- dashboardBasePath: string;
66
64
  siteURL: string;
67
65
  configuredGlobalURL?: string;
68
66
  configuredRegionalURL?: string;