Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent login if Git Gateway is disabled. #1295

Merged
merged 1 commit into from
May 15, 2018
Merged

Conversation

tech4him1
Copy link
Contributor

@tech4him1 tech4him1 commented Apr 20, 2018

- Summary

Fixes #1272.

If Git Gateway was disabled, we were still allowing the user to log in, which can cause them to lose their work when they cannot save it.

- Test plan

Manually tested with both scenarios: #1272 (comment).

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@@ -78,7 +78,11 @@ export default class API {
if (contentType && contentType.match(/json/)) {
return this.parseJsonResponse(response);
}
return response.text();
const text = response.text();
if (!response.ok) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Benaiah Is there any problem internally if we reject on not-OK responses for all content-types? We do on JSON responses already (see parseJsonResponse).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tech4him1 yeah - I actually thought it was supposed to be doing so already. If the caller is expecting a non-ok response it can catch the APIError.

@verythorough
Copy link
Contributor

Deploy preview for cms-demo ready!

Built with commit 2a58992

https://deploy-preview-1295--cms-demo.netlify.com

@verythorough
Copy link
Contributor

Deploy preview for netlify-cms-www ready!

Built with commit 2a58992

https://deploy-preview-1295--netlify-cms-www.netlify.com

Copy link
Contributor

@erquhart erquhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tech4him1 apologies for just now getting to this, lgtm.

@erquhart erquhart merged commit 80817e2 into master May 15, 2018
@erquhart erquhart deleted the git-gateway-check-status branch May 15, 2018 22:34
brianlmacdonald pushed a commit to brianlmacdonald/netlify-cms that referenced this pull request May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: Unrecognized front-matter format. + TypeError: e.commit is undefined
4 participants