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

PR for ES-1843 #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/public/react/components/ConnectionModal.react.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var ConnectionModal = React.createClass({
return [
window.env.userUrl + '?',
'response_type=code',
'&scope=openid%20profile',
'&scope=' + encodeURIComponent(this.state.connection.options.scope),
Copy link
Contributor

Choose a reason for hiding this comment

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

this.state.connection does not update on _save. So you have to re-open modal dialog to update the URL.
I'd suggest this:

var connection = this.state.connectionForm && this.state.connectionForm.getConnection() || this.state.connection;
return [
      window.env.userUrl + '?',
      'response_type=code',
      '&scope=' + encodeURIComponent(connection.options.scope),
      '&client_id=' + window.env.masterClientId,
      '&connection=' + this.state.connection.name,
      '&redirect_uri=' + window.env.manageUrl + '/tester/callback?connection=' + this.state.connection.name
    ].join('');

Copy link
Author

Choose a reason for hiding this comment

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

I have no way to really test this properly, I have no local test environment. I also am not familiar with this code base of the extension. Please consider my suggestion just as pseudo-code then :)
Happy to go with your suggestion if it works, as I don't have a way to test it. I trust a product engineer here more than my own code.

'&client_id=' + window.env.masterClientId,
'&connection=' + this.state.connection.name,
'&redirect_uri=' + window.env.manageUrl + '/tester/callback?connection=' + this.state.connection.name
Expand Down