Improved https redirects

This commit is contained in:
Igor Zhukov 2014-11-17 13:47:48 +03:00
parent 94e0be9668
commit a73943f7ed

View File

@ -15,9 +15,14 @@ angular.module('myApp.controllers', ['myApp.i18n'])
MtpApiManager.getUserID().then(function (id) { MtpApiManager.getUserID().then(function (id) {
if (id) { if (id) {
$location.url('/im'); $location.url('/im');
} else { return;
$scope.showWelcome = true;
} }
if (location.protocol == 'http:' &&
Config.App.domains.indexOf(location.hostname) != -1) {
location = 'https://web.telegram.org';
return;
}
$scope.showWelcome = true;
}); });
ChangelogNotifyService.checkUpdate(); ChangelogNotifyService.checkUpdate();
@ -36,7 +41,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
} }
if (location.protocol == 'http:' && if (location.protocol == 'http:' &&
Config.App.domains.indexOf(location.hostname) != -1) { Config.App.domains.indexOf(location.hostname) != -1) {
location = 'https://web.telegram.org'; location = 'https://web.telegram.org/#/login';
} }
}); });
var options = {dcID: 2, createNetworker: true}, var options = {dcID: 2, createNetworker: true},