aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/app.js')
-rw-r--r--src/js/app.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/js/app.js b/src/js/app.js
index 6fbb399..951bcf3 100644
--- a/src/js/app.js
+++ b/src/js/app.js
@@ -1 +1,13 @@
// 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")
+ gotrue.acceptInvite(m[1], pw)
+ .then(() => { document.location.href = "/admin/"; })
+ .catch((err) => alert("Failed to verify invite token :("))
+ }
+}