 });


        function oauth2_authorize(type) {
            $.get('/oauth2/render/' + type.toLowerCase(), function (data) {
                console.log(data);
                handlerResult(data, renderDone);
            });
        }

        function renderDone(data) {
            var winObj = window.open(data, 'newwindow', 'height=500, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
            var loop = setInterval(function() {
                if