@fynd-design-engineering/fynd-one-v2 3.4.21 → 3.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/global/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let
|
|
1
|
+
"use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let r="https://api.console.fynd.com/service/panel/auth/v1.0/session/";function o(e){document.querySelectorAll("[fynd-console-auth-status]").forEach(s=>{s.setAttribute("fynd-console-auth-status",e?"true":"false")})}function a(e){let n=e.firstName||"",s=n.charAt(0)||"";o(!0),document.querySelectorAll('[fynd-console-auth="name"]').forEach(t=>{t.textContent=n}),document.querySelectorAll('[fynd-console-auth="user-blob"]').forEach(t=>{t.style.display="block"}),document.querySelectorAll('[fynd-console-auth="initial-text"]').forEach(t=>{t.textContent=s});let c=document.querySelectorAll('[fynd-console-auth="image"]');e.profilePicUrl?c.forEach(t=>{t.src=e.profilePicUrl,t.style.display="block"}):c.forEach(t=>{t.style.display="none"})}function l(){o(!1),document.querySelectorAll('[fynd-console-auth="user-blob"]').forEach(s=>{s.style.display="none"}),document.querySelectorAll('[fynd-console-auth="name"]').forEach(s=>{s.textContent="Sign in"})}fetch(r,{method:"GET",credentials:"include"}).then(e=>e.json()).then(e=>{let n=e.user;n&&n.firstName?a(n):l()}).catch(()=>{l()})});})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var c="user-id";function
|
|
1
|
+
"use strict";(()=>{var c="user-id";function a(e,n,i=365){let s=new Date(Date.now()+i*864e5).toUTCString(),r=location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${encodeURIComponent(n)}; Expires=${s}; Path=/; SameSite=Lax${r}`}function u(e){let n=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return n?decodeURIComponent(n[2]):null}function d(){let e=u(c);return e||(typeof crypto<"u"&&"randomUUID"in crypto?e=crypto.randomUUID():e=`rid_${Date.now()}_${Math.random().toString(36).slice(2,10)}`,a(c,e,365*5),console.log("Created new RID:",e),e)}window.getRid=function(){return d()};document.addEventListener("DOMContentLoaded",()=>{let e=d(),n=window.posthog,i=n&&typeof n.get_distinct_id=="function"?n.get_distinct_id():null,s=n&&typeof n.get_session_id=="function"?n.get_session_id():null;document.querySelectorAll('a[href*="console.fynd.com"], a[href^="https://console.fynd.com/"], a[href="https://console.fynd.com"]').forEach(t=>{try{let o=new URL(t.href);o.hostname.includes("console.fynd.com")&&(o.searchParams.set("referrer_uuid",e),i&&o.searchParams.set("ph_distinct_id",i),s&&o.searchParams.set("ph_session_id",s),t.href=o.toString())}catch{console.warn("Invalid URL in link:",t.href)}}),document.querySelectorAll("[fynd-form-field='uuid']").forEach(t=>{t instanceof HTMLInputElement&&(t.value=e)})});})();
|
package/package.json
CHANGED