-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amélioration de la gestion des users internes dans PostHog (#146)
* Improve internal users management * wip * clear netlify cache * remove useless variables * Fix sitemap exclusioon key * update posthog script * Accidental change * script key * extract function getCookie
- Loading branch information
1 parent
547d82f
commit afb3d69
Showing
9 changed files
with
396 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React, { useEffect } from "react"; | ||
import { setCookie } from "utils/cookies" | ||
import Web from "components/layout/Web"; | ||
|
||
export default function Disableposthog() { | ||
useEffect(() => { | ||
setCookie("disable-posthog", "1", 365) | ||
window.location.href = "/" | ||
}, []); | ||
|
||
return ( | ||
<Web> | ||
Un cookie est en train d'être déposé. | ||
Vous allez être redirigé vers la page d'accueil. | ||
</Web> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
export function setCookie(name: string, value: string, days: number) { | ||
const expirationDate = new Date(); | ||
expirationDate.setTime(expirationDate.getTime() + days * 24 * 60 * 60 * 1000); | ||
document.cookie = `${name}=${value}; expires=${expirationDate.toUTCString()}; path=/` | ||
} | ||
|
||
export function getCookie(name: string, value: string) { | ||
return document.cookie.split("; ").find(row => row === `${name}=${value}`) | ||
} |
Oops, something went wrong.