Skip to content

Commit

Permalink
Update preferences.js
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Jan 26, 2025
1 parent eb74d61 commit ea636c0
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/pages/cipp/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,6 @@ const Page = () => {
const settings = useSettings();
const formcontrol = useForm({ mode: "onChange", defaultValues: settings });

// retrieve StaticWebAppsAuthCookie from browser cookies
const cookieString = document.cookie
.split("; ")
.find((row) => row.startsWith("StaticWebAppsAuthCookie="));
const StaticWebAppsAuthCookie = cookieString.split("=")[1];
// base64 decode the cookie and log
console.log(atob(StaticWebAppsAuthCookie));

// retrieve the expiration date of the cookie
const expires = cookieString.split(";").find((part) => part.trim().startsWith("expires="));
if (expires) {
const expirationDate = new Date(expires.split("=")[1]);
console.log("Cookie expiration date:", expirationDate);
} else {
console.log("No expiration date found for the cookie.");
}


const addedAttributes = [
{ value: "consentProvidedForMinor", label: "consentProvidedForMinor" },
{ value: "employeeId", label: "employeeId" },
Expand Down

0 comments on commit ea636c0

Please sign in to comment.