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

Fix federated param #661

Merged
merged 3 commits into from
Feb 14, 2018
Merged

Fix federated param #661

merged 3 commits into from
Feb 14, 2018

Conversation

luisrudge
Copy link
Contributor

@luisrudge luisrudge commented Feb 9, 2018

the federated param is a special param because you don't send the value with it. So, the url should be /logout?federated and not logout?federated=true|false. Because we suggest in the docs that we might accept a string in this case, I had to keep it compatible with previous versions, that's why we have some special if conditions.

@luisrudge luisrudge added this to the v9.2.3 milestone Feb 9, 2018
qString = qs.stringify(objectHelper.blacklist(params, ['federated']));
if (
options &&
(options.federated !== undefined &&
Copy link
Contributor

Choose a reason for hiding this comment

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

@luisrudge - Parens not needed here.

Logic is confusing here but I understand why. Just breaking it down ...

  • No options === no federated option so that makes sense
  • For the last one, wouldn't options.federated === 'true' be a little more explicit here?
  • For the 2nd and 3rd, you're checking for undefined and false in the case where federated is in the URL but not set. Wouldn't it just be one or the other or are there browser differences being accounted for? I'm wondering if it's not better to say Object.keys(options).indexOf('federated') > -1, then decide the values that should be true (probably 'true' and undefined)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue with using object.keys is that, in our docs, we recommended doing: federated: ''. But there's all sorts of usage, including federated: 'true', federated: true, federated: 'false' (which would be true if I used object.keys only). So, I'm doing a "catch all false possibilities" in this if check just in case.

@luisrudge luisrudge merged commit 1bd00f2 into master Feb 14, 2018
@luisrudge luisrudge deleted the fix-federated-param branch February 14, 2018 12:21
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.

3 participants