Commit a2f817e8 authored by PhoeniX's avatar PhoeniX

Two-factor authorization fix

parent 0ed159dd
......@@ -10,14 +10,11 @@ window.onload = function(){
f.style.height = '100%';
var
returl = 'https://oauth.vk.com/blank.html',
authurl = 'https://oauth.vk.com/authorize?client_id=4374753&scope='+encodeURIComponent(VK.permissions)+'&redirect_uri='+encodeURIComponent(returl)+'&display=mobile&v=5.21&response_type=token&revoke=1';
authurl = 'https://oauth.vk.com/authorize?client_id=4374753&scope='+encodeURIComponent(VK.permissions)+'&redirect_uri='+encodeURIComponent(returl)+'&display=mobile&v=5.26&response_type=token&revoke=1';
f.addEventListener('mozbrowserlocationchange',function(e){
if (e.detail.indexOf("https://m.vk.com/settings") == 0) return true;
if (e.detail.indexOf("https://oauth.vk.com/") != 0) {
this.src = authurl;
return false;
}
if (e.detail.indexOf("https://oauth.vk.com/blank.html") == 0) {
if (e.detail.indexOf("https://login.vk.com/") == 0) return null;
if (e.detail.indexOf("https://m.vk.com/login?act=authcheck") == 0) return null;
if (e.detail.indexOf(returl) == 0) {
f.remove();
var url = e.detail.split('#')[1].split('&'), params = {};
for (var i = 0; i < url.length; i++) {
......@@ -28,6 +25,12 @@ window.onload = function(){
}
window.onload();
}
if (e.detail.indexOf("https://oauth.vk.com/") != 0) {
this.src = authurl;
e.preventDefault();
e.stopPropagation();
return false;
}
});
document.body.appendChild(f);
f.src = authurl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment