Skip to content

Conversation

@mjsalinger
Copy link
Contributor

Fixes #46 by adding any query parameters in the passed-in login url to the resulting generated url.


uri.query = _.extend(query, uri.query)
uri.search = null
uri.query = query
Copy link
Contributor

@cozmo cozmo Jul 26, 2016

Choose a reason for hiding this comment

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

Unless I'm missing something I think this logic could be cleaned up a bit by replacing lines 501-512 with the following. Thoughts?

uri = url.parse identity_provider.sso_login_url, true
if options.sign_get_request
  _(uri.query).extend sign_request(deflated.toString('base64'), @private_key, options.relay_state)
else
  uri.query.SAMLRequest = deflated.toString('base64')
  uri.query.RelayState = options.relay_state if options.relay_state?
uri.search = null # If you provide search and query search overrides query :/

It's possible I'm missing some intricacy of the logic here though and if so please correct me :D

@cozmo
Copy link
Contributor

cozmo commented Aug 30, 2016

Closing this as I've fixed it in #79 - Thanks for the initial PR. Published as 1.8.1 on npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants