PlotDirector/PlotLine/wwwroot/js/context-environment.js

3 lines
405 B
JavaScript

// A browser-profile preference, never an authentication credential. It prevents remote-device navigation.
(() => {const user=document.body.dataset.pdUserId;if(!user)return;let id;try{const key='pd.context.environment.'+user;id=localStorage.getItem(key);if(!/^[a-f0-9-]{36}$/i.test(id||'')){id=crypto.randomUUID();localStorage.setItem(key,id);}}catch{}window.PlotDirectorContextEnvironment=id||null;})();