Skip to content
Snippets Groups Projects
Commit 55ea58d9 authored by Eloi Perdereau's avatar Eloi Perdereau
Browse files

netlify identity in scripts.html + fix locale

parent 8509a530
No related branches found
No related tags found
No related merge requests found
......@@ -37,3 +37,20 @@
<script src="{{ script_path }}"></script>
{% endfor %}
{% endif %}
<script>
if (window.netlifyIdentity) {
window.netlifyIdentity.on("init", user => {
if (!user) {
window.netlifyIdentity.on("login", () => {
gotrueUser = window.netlifyIdentity.gotrue.currentUser()
if (gotrueUser.email == "judl@luminy.org") {
window.netlifyIdentity.logout();
} else {
document.location.href = "/lepuget/";
}
});
}
});
}
</script>
......@@ -8,12 +8,8 @@
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</head>
<body>
<!-- Locale translate script -->
<script>
import CMS from 'netlify-cms-app';
import { fr } from 'netlify-cms-locales';
CMS.registerLocale('fr', fr);
window.netlifyIdentity.setLocale("fr");
</script>
<!-- Include the script that builds the page and powers Netlify CMS -->
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment