Don't read preferred idp, just because user selected it
Basics
Technical
Logistics
Basics
Technical
Logistics
Description
Currently any preferred idp gets a duplicate entry in the preferred idp list, after the user selected it for the first time.
The attached patch fixes a small bug in the loop (j has to be checked against userSelectedIdPs, not i) , too.
indexOf is part of ECMAScript 5 standard and seems to be supported by all modern browsers. See: https://kangax.github.io/compat-table/es5/ It is only unsupported in IE < Version 9 and iOS 5.1 and lower.
Environment
None
Attachments
1
Activity
Rod Widdowson
September 28, 2022 at 2:47 PM
closing
Rod Widdowson
January 19, 2017 at 2:59 PM
Thanks for the bug.
It took me some time to relaize that you fixed another bug in that code (using the wrong index) before I could repro your issue.
With that done I applied the patch you provided. I was slightly nervous about IE < 9 (after all we only gave up on IE6 last year...) and so I put in a blade guard againsy typeof idp.IndexOf being 'undefined' in which case we just introduce the same bug.
There is probably a neater way of doing this, but my JavaScript is currently swapped out under a mount of Java/C#/C++ and C..
Currently any preferred idp gets a duplicate entry in the preferred idp list, after the user selected it for the first time.
The attached patch fixes a small bug in the loop (j has to be checked against userSelectedIdPs, not i) , too.
indexOf is part of ECMAScript 5 standard and seems to be supported by all modern browsers.
See: https://kangax.github.io/compat-table/es5/
It is only unsupported in IE < Version 9 and iOS 5.1 and lower.