1var bind = _.bind; 2/* 3validates the claims and returns the access token for this session. 4*/ 5function koreAnonymousFn(options) { 6 console.info("anonymous user login"); 7 /* 8 generates the UUID for anonymous user. 9 */ 10 function koreGenerateUUID() { 11 console.info("generating UUID"); 12 var d = new Date().getTime(); 13 if (window.performance && typeof window.performance.now === "function") { 14 d += performance.now(); //use high-precision timer if available 15 } 16 var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { 17 var r = (d + Math.random() * 16) % 16 | 0; 18 d = Math.floor(d / 16); 19 return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16); 20 }); 21 return uuid; 22 } 23 24 var korecookie = localStorage.getItem("korecom"); 25 var uuid = (korecookie) || koreGenerateUUID(); 26 27 localStorage.setItem("korecom", uuid); 28 29 if (!options.clientId) { 30 console.log("clientId should be there for anonymous user"); 31 return; 32 } 33 var assertion = {}; 34 assertion.issuer = options.clientId; 35 assertion.subject = uuid; 36 37 options.assertion = assertion; 38 39 this.options = options; 40 this.claims = options.assertion; 41 this.WebClient = new this.clients.KoreWebClient({}, this.options); 42 this.WebClient.claims = this.claims; 43 this.WebClient.anonymouslogin.login({ 44 "assertion": options.assertion, 45 "botInfo": this.options.botInfo 46 }, bind(this.onLogIn, this)); 47 48}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.