(function($){ 'use strict'; $("#meControl").css('display','block'); $.ajax({ type: 'POST', dataType: 'json', url: rooalObj.rooalAjaxurl }) .done(function (data) { if (typeof data['isSignedIn'] !== 'undefined' && data['isSignedIn'] === true) { var currAccount = { type: data['authType'].toLowerCase(), authenticatedState: 'signedIn', memberName: data['userName'], firstName: data['firstName'], lastName: data['lastName'], cid: data['msaID'] }; if (typeof window.MeControl != 'undefined' && typeof window.MeControl.API != 'undefined') { window.MeControl.API.setActiveAccount(currAccount); } else { if (typeof window.shellOptions == 'undefined') { window.shellOptions = {}; } if ( typeof shellOptions.meControlOptions == 'undefined' ) { shellOptions.meControlOptions = {}; } shellOptions.meControlOptions.currentAccount = currAccount; } } }) .fail(function () { console.log('rOAL Ajax FAILED'); sessionStorage.getUserStatusState = 'failed'; }); })(jQuery);