Skip to content

Commit 2998060

Browse files
committed
fix: ensure dev settings for url is only visible on dev
1 parent c2685bf commit 2998060

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/components/app.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,13 @@ class App extends Component {
9191
const page = pages[store.modal.page] || {};
9292
const pageLinkHandler = () => this.handlePage(page.link);
9393

94-
if (!store.gotrue) {
95-
return <SiteURLForm onSiteURL={this.handleSiteURL} />;
94+
if (process.env.NODE_ENV === "development" && store.siteURL === null) {
95+
return (
96+
<SiteURLForm
97+
devMode={store.siteURL != null}
98+
onSiteURL={store.siteURL ? this.clearSiteURL : this.handleSiteURL}
99+
/>
100+
)
96101
}
97102
if (!store.settings) {
98103
return;
@@ -127,7 +132,14 @@ class App extends Component {
127132
{page.link_text}
128133
</button>
129134
)}
130-
<SiteURLForm devMode="true" onSiteURL={this.clearSiteURL} />
135+
{process.env.NODE_ENV === "development" ? (
136+
<SiteURLForm
137+
devMode={store.siteURL != null}
138+
onSiteURL={store.siteURL ? this.clearSiteURL : this.handleSiteURL}
139+
/>
140+
) : (
141+
<div />
142+
)}
131143
</div>
132144
);
133145
}

src/netlify-identity.js

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function instantiateGotrue(APIUrl) {
8484
parts.push("/")
8585
}
8686
parts.push(".netlify/identity")
87+
store.setSiteURL(siteURL)
8788
return new GoTrue({ APIUrl: parts.join(""), setCookie: !isLocal })
8889
}
8990
if (isLocal) {

0 commit comments

Comments
 (0)