From 955b545f30018048a43feb71b94f351a3c202773 Mon Sep 17 00:00:00 2001 From: Mathias Biilmann Christensen Date: Wed, 6 Sep 2017 05:47:26 -0700 Subject: Testing new CMS version --- src/js/app.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/js/app.js b/src/js/app.js index bdf5699..0a7084a 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,14 +1,6 @@ // JS Goes here - ES6 supported -import GoTrue from "gotrue-js"; - -if (document.location.hash) { - const m = document.location.hash.match(/invite_token=([^&]+)/); - if (m) { - document.location.hash = ""; - const pw = prompt("Please pick a password") - const gotrue = new GoTrue(); - gotrue.acceptInvite(m[1], pw) - .then(() => { document.location.href = "/admin/"; }) - .catch((err) => alert("Failed to verify invite token :(")) - } +if (window.netlifyIdentity) { + window.netlifyIdentity.on('login', () => { + document.location.href = '/admin/'; + }); } -- cgit v1.3