diff options
Diffstat (limited to 'src/js/app.js')
| -rw-r--r-- | src/js/app.js | 16 |
1 files changed, 4 insertions, 12 deletions
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/'; + }); } |
