From c0458bb563926b17b2db91ad571ca10eb90cb802 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 17 Nov 2014 13:52:19 +0300 Subject: [PATCH] Added http checks for im Closes #575 --- app/js/controllers.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index a944629a..dc9c11c1 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -612,8 +612,13 @@ angular.module('myApp.controllers', ['myApp.i18n']) }, function (error) { if (error.code == 401) { MtpApiManager.logOut()['finally'](function () { - location.hash = '/login'; - AppRuntimeManager.reload(); + if (location.protocol == 'http:' && + Config.App.domains.indexOf(location.hostname) != -1) { + location = 'https://web.telegram.org/#/login'; + } else { + location.hash = '/login'; + AppRuntimeManager.reload(); + } }); error.handled = true; }