javascript sdk tweaks to allow for smoother login flow