Duo Web javascript broken
I was working on implementing the Duo Web SDK with a piece of our software, but ran into an issue. I ended up having to modify the Duo-Web-v1.js in order to make it work. I wanted to bring this to your attention so that it can be addressed.
The issue is, you're calling Duo.ready() within the (document).ready() jquery method. This gets called immediately and well before the Duo.init() method is called, meaning the options passed to Duo.init() do not get used. This results in an undefined host being used in the iframe source. The solution I used was to remove the jquery document.ready() part, and add a Duo.ready() call to the end of Duo.init().
Thanks for using Duo! You're correct that Duo.init must be called before Duo.ready is called, and if you take a look at the demo code provided you can see how that's done. In demos/simple/index.php lines 66-71, note that Duo-Init.js is executed immediately while the document is loading, while Duo.ready is wrapped with jquery to be called only after the document loading is complete.
You'll need to do the same when integrating the Duo Web SDK with your software.
Thanks for the response. Personally, I dont think that relying on the load order is the best method for this to work. There are too many unknowns which may cause the init to load AFTER the .ready is called.