aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/app.js
blob: bdf56996e942c25facfe0935e7bd37868ed59ff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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 :("))
  }
}