Reworked JS OAuth sign in to fix window comm. issues