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

allow custom auth endpoint #1294

Merged
merged 1 commit into from Apr 25, 2018

Conversation

Projects
None yet
4 participants
@erquhart
Member

erquhart commented Apr 20, 2018

- Summary

Currently the path "/auth" is enforced for authentication, even with a custom base_url. Developers should be able to override the default endpoint.

Fixes #1285.

- Description for the changelog

allow custom auth endpoint

@verythorough

This comment has been minimized.

Contributor

verythorough commented Apr 20, 2018

Deploy preview for cms-demo ready!

Built with commit 55ff84f

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

@erquhart erquhart force-pushed the auth-endpoint branch from cfb2907 to 8cc6bb3 Apr 20, 2018

@verythorough

This comment has been minimized.

Contributor

verythorough commented Apr 20, 2018

Deploy preview for netlify-cms-www ready!

Built with commit 55ff84f

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

@verythorough

This comment has been minimized.

Contributor

verythorough commented Apr 20, 2018

Deploy preview for netlify-cms-www ready!

Built with commit cfb2907

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

@erquhart erquhart force-pushed the auth-endpoint branch from 8cc6bb3 to fb082fc Apr 20, 2018

@verythorough

This comment has been minimized.

Contributor

verythorough commented Apr 20, 2018

Deploy preview for cms-demo ready!

Built with commit cfb2907

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

@verythorough

This comment has been minimized.

Contributor

verythorough commented Apr 20, 2018

Deploy preview for netlify-cms-www ready!

Built with commit 8cc6bb3

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

@verythorough

This comment has been minimized.

Contributor

verythorough commented Apr 20, 2018

Deploy preview for cms-demo ready!

Built with commit 8cc6bb3

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

@verythorough

This comment has been minimized.

Contributor

verythorough commented Apr 20, 2018

Deploy preview for netlify-cms-www ready!

Built with commit fbe49b0

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

@verythorough

This comment has been minimized.

Contributor

verythorough commented Apr 20, 2018

Deploy preview for cms-demo ready!

Built with commit fbe49b0

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

@erquhart

This comment has been minimized.

Member

erquhart commented Apr 20, 2018

@marksteele please test and confirm this works for your use case.

@marksteele

I can confirm that the fix addresses my issue.

@erquhart erquhart requested review from talves and tech4him1 Apr 23, 2018

@tech4him1

This comment has been minimized.

Collaborator

tech4him1 commented Apr 23, 2018

@erquhart I'm good with this. I do wonder, however, if it would just be better to have a new setting like auth_url that would replace the base_url and authEndpoint at once. base_url is already really unclear in my opinion.

@erquhart

This comment has been minimized.

Member

erquhart commented Apr 23, 2018

I considered that, but base_url is used in a few places. We'd need to make sure it's okay to get rid of.

Sent with GitHawk

@tech4him1

This comment has been minimized.

Collaborator

tech4him1 commented Apr 24, 2018

Hmm, that may be necessary, but I only see it used with netlify-auth.js (and the components that forward the value to it).

@erquhart

This comment has been minimized.

Member

erquhart commented Apr 24, 2018

I believe we're using it to test against the origin property of the MessageEvent from the popup, so we need the stripped origin. We could strip it from auth_url internally, though. Just another moving part is all.

I'm inclined to go with what's in this PR since it's backward compatible, and maybe provide the more ideal solution you're describing in a 2.0 PR. What do you think? If you'd really rather us go for it, it's a matter of someone having time.

@tech4him1

This comment has been minimized.

Collaborator

tech4him1 commented Apr 24, 2018

2.0 is fine, go for it.

@@ -84,6 +84,7 @@ class App extends React.Component {
isFetching: auth && auth.get('isFetching'),
siteId: this.props.config.getIn(["backend", "site_domain"]),
base_url: this.props.config.getIn(["backend", "base_url"], null),
authEndpoint: this.props.config.getIn(["backend", "auth_endpoint"]),

This comment has been minimized.

@tech4him1

tech4him1 Apr 24, 2018

Collaborator

I wonder if we should make backends get the value themselves, instead of passing them all in here. Maybe a 2.0 thing?

This comment has been minimized.

@erquhart

erquhart Apr 25, 2018

Member

2.0, but yeah that definitely makes sense. @Benaiah what do you think?

@erquhart erquhart force-pushed the auth-endpoint branch from fb082fc to fbe49b0 Apr 25, 2018

@erquhart erquhart merged commit 855bfde into master Apr 25, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
netlify/netlify-cms-www/deploy-preview Deploy preview ready!
Details

@tech4him1 tech4him1 deleted the auth-endpoint branch Apr 25, 2018

brianlmacdonald added 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