enable org registration

ref #15
This commit is contained in:
Philipp Dormann 2021-03-25 19:51:44 +01:00
parent a39cf75c7f
commit 7904151a52
3 changed files with 5 additions and 9 deletions

View File

@ -97,11 +97,8 @@ import Toastify from "toastify-js";
let mail = ref("");
let loading = ref(false);
function login() {
console.log("ihi");
console.log(mail.value);
loading.value = true;
axios.get("").then((res) => {
console.log(res.data);
loading.value = false;
Toastify({
text: "This is a toast",

View File

@ -97,11 +97,8 @@ import Toastify from "toastify-js";
let mail = ref("");
let loading = ref(false);
function login() {
console.log("ihi");
console.log(mail.value);
loading.value = true;
axios.get("").then((res) => {
console.log(res.data);
loading.value = false;
Toastify({
text: "This is a toast",

View File

@ -238,7 +238,6 @@ if (props.token) {
props.token = atob(props.token);
axios.get(`${config.baseurl}api/organizations/selfservice/${props.token}`)
.then(({ data }) => {
console.log(data);
state.org_name = data.name;
})
.catch((error) => {
@ -281,10 +280,13 @@ function login() {
}
}
toast("registration in progress...");
axios.post(`${config.baseurl}api/runners/register`, postdata)
let url = `${config.baseurl}api/runners/register`;
if (props.token) {
url = `${config.baseurl}api/runners/register/${props.token}`
}
axios.post(url, postdata)
.then(({ data }) => {
const token = btoa(data.token);
// const userid = JSON.parse(atob(token.split(".")[1])).id;
location.replace("../profile/" + token)
//
toast.success("You have been registered!");