Skip to content

Commit

Permalink
fix: ensure dev settings for url is only visible on dev
Browse files Browse the repository at this point in the history
  • Loading branch information
shortdiv committed Jun 4, 2019
1 parent c2685bf commit 2998060
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ class App extends Component {
const page = pages[store.modal.page] || {};
const pageLinkHandler = () => this.handlePage(page.link);

if (!store.gotrue) {
return <SiteURLForm onSiteURL={this.handleSiteURL} />;
if (process.env.NODE_ENV === "development" && store.siteURL === null) {
return (
<SiteURLForm
devMode={store.siteURL != null}
onSiteURL={store.siteURL ? this.clearSiteURL : this.handleSiteURL}
/>
)
}
if (!store.settings) {
return;
Expand Down Expand Up @@ -127,7 +132,14 @@ class App extends Component {
{page.link_text}
</button>
)}
<SiteURLForm devMode="true" onSiteURL={this.clearSiteURL} />
{process.env.NODE_ENV === "development" ? (
<SiteURLForm
devMode={store.siteURL != null}
onSiteURL={store.siteURL ? this.clearSiteURL : this.handleSiteURL}
/>
) : (
<div />
)}
</div>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/netlify-identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function instantiateGotrue(APIUrl) {
parts.push("/")
}
parts.push(".netlify/identity")
store.setSiteURL(siteURL)
return new GoTrue({ APIUrl: parts.join(""), setCookie: !isLocal })
}
if (isLocal) {
Expand Down

0 comments on commit 2998060

Please sign in to comment.