aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMathias Biilmann Christensen <info@mathias-biilmann.net>2017-09-06 05:47:26 -0700
committerMathias Biilmann Christensen <info@mathias-biilmann.net>2017-09-06 05:47:26 -0700
commit955b545f30018048a43feb71b94f351a3c202773 (patch)
tree25067e07eba3b7155c7281c613d0a86cb9f03ae1 /src
parentf68de75059c964116bb8dfee7df895a0468b95ae (diff)
Testing new CMS version
Diffstat (limited to 'src')
-rw-r--r--src/js/app.js16
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/';
+ });
}