will still try default if cookie config failed

This commit is contained in:
Jimmy Z 2016-03-10 14:55:29 +08:00
parent ce84a36875
commit dab552c255

View File

@ -9,16 +9,15 @@ angular
function(syscall, globalTimeout, alerts, utils, rootScope, uri, authconf) { function(syscall, globalTimeout, alerts, utils, rootScope, uri, authconf) {
var subscriptions = [] var subscriptions = []
, configurations , configurations = [authconf]
, currentConf = {} , currentConf = {}
, currentToken , currentToken
, timeout = null , timeout = null
, forceNextUpdate = false; , forceNextUpdate = false;
var cookieConf = utils.getCookie('aria2conf'); var cookieConf = utils.getCookie('aria2conf');
// try at the start, so that it is presistant even when default authconf works // try at the start, so that it is presistant even when default authconf works
configurations = [cookieConf ? cookieConf : authconf]; if(cookieConf) configurations.unshift(cookieConf);
if (['http', 'https'].indexOf(uri.protocol()) != -1 && uri.host() != 'localhost') { if (['http', 'https'].indexOf(uri.protocol()) != -1 && uri.host() != 'localhost') {
console.log(uri.host()); console.log(uri.host());