@authhero/react-admin 0.25.0 → 0.26.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @authhero/react-admin
2
2
 
3
+ ## 0.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c89fb59: Skip dialog if there is a env varitable for environment
8
+
3
9
  ## 0.25.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authhero/react-admin",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "packageManager": "pnpm@10.20.0",
5
5
  "private": false,
6
6
  "repository": {
package/src/index.tsx CHANGED
@@ -7,24 +7,12 @@ import { AuthCallback } from "./AuthCallback";
7
7
  import { DomainSelector } from "./components/DomainSelector";
8
8
  import { getSelectedDomainFromStorage } from "./utils/domainUtils";
9
9
 
10
- // Check if running on local.authhero.net - if so, auto-connect to localhost:3000
11
- const isLocalDevelopment = window.location.hostname.startsWith("local.");
12
- const LOCAL_DOMAIN = "localhost:3000";
13
-
14
- // Check if single domain mode is enabled - skips the domain selector entirely
15
- const isSingleDomainMode = import.meta.env.VITE_SINGLE_DOMAIN_MODE === "true";
10
+ // If a domain is configured via env, use single-domain mode automatically
16
11
  const envDomain = import.meta.env.VITE_AUTH0_DOMAIN;
17
12
 
18
13
  function Root() {
19
- // In single domain mode, always use the configured domain from env
20
- const getInitialDomain = () => {
21
- if (isLocalDevelopment) return LOCAL_DOMAIN;
22
- if (isSingleDomainMode && envDomain) return envDomain;
23
- return null;
24
- };
25
-
26
14
  const [selectedDomain, setSelectedDomain] = useState<string | null>(
27
- getInitialDomain(),
15
+ envDomain || null,
28
16
  );
29
17
  const currentPath = location.pathname;
30
18
  const isAuthCallback = currentPath === "/auth-callback";
@@ -35,10 +23,9 @@ function Root() {
35
23
  currentPath.startsWith("/tenants/create") ||
36
24
  currentPath === "/tenants/";
37
25
 
38
- // Load domain from cookies on component mount (skip for local development and single domain mode)
26
+ // Load domain from cookies on component mount (only when no env domain configured)
39
27
  useEffect(() => {
40
- if (isLocalDevelopment || isSingleDomainMode) {
41
- // For local development or single domain mode, always use the configured domain
28
+ if (envDomain) {
42
29
  return;
43
30
  }
44
31
  const savedDomain = getSelectedDomainFromStorage();
@@ -58,9 +45,8 @@ function Root() {
58
45
  );
59
46
  }
60
47
 
61
- // Show domain selector on root path or if no domain is selected
62
- // Skip for local development and single domain mode - redirect to /tenants instead
63
- if (!isLocalDevelopment && !isSingleDomainMode && (isRootPath || !selectedDomain)) {
48
+ // Show domain selector only if no domain is selected
49
+ if (!selectedDomain) {
64
50
  return (
65
51
  <DomainSelector
66
52
  onDomainSelected={(domain) => setSelectedDomain(domain)}
@@ -69,14 +55,8 @@ function Root() {
69
55
  );
70
56
  }
71
57
 
72
- // For single domain mode on root path, redirect to /tenants
73
- if (isSingleDomainMode && isRootPath) {
74
- window.location.href = "/tenants";
75
- return null;
76
- }
77
-
78
- // For local development on root path, redirect to /tenants
79
- if (isLocalDevelopment && isRootPath) {
58
+ // For env-configured domain on root path, redirect to /tenants
59
+ if (envDomain && isRootPath) {
80
60
  window.location.href = "/tenants";
81
61
  return null;
82
62
  }
@@ -106,12 +86,7 @@ function Root() {
106
86
  );
107
87
  }
108
88
 
109
- // Fallback to domain selector (or redirect for local development)
110
- if (isLocalDevelopment) {
111
- window.location.href = "/tenants";
112
- return null;
113
- }
114
-
89
+ // Fallback to domain selector
115
90
  return (
116
91
  <DomainSelector
117
92
  onDomainSelected={(domain) => setSelectedDomain(domain)}