-
-
Save studentIvan/f3af1aafb6299ce10802 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
vm.vkAuth = function () { | |
var chWindow = $window.open('http://' + $document[0].domain + '/app/login/vk-oauth2/'); | |
// открываем новую вкладку, без ангуляра это window.open('/app/login/vk-oauth2/'); | |
var chInterval = $interval(function() { // без ангуляра это просто setInterval | |
if (chWindow.closed) { | |
// всплывающее окно с соц. авторизацией закрыто - нужно перепроверить сессию | |
$log.debug('child window closed - reload seesion pls =)'); | |
$interval.cancel(chInterval); | |
} | |
}, 100); | |
}; | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment