|
|
@@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<form v-if="active === 'register'" v-on:submit="register" id="register-form"> |
|
|
|
<form v-if="active === 'register'" onsubmit = "event.preventDefault(); return false" id="register-form"> |
|
|
|
<h3>Registration</h3> |
|
|
|
<div>{{errorMessage}}</div> |
|
|
|
<div> |
|
|
@@ -22,7 +22,7 @@ |
|
|
|
<input v-on:input="checkPasswords" id='confirm-password' required type='password' |
|
|
|
name='sender_password' placeholder='' spellcheck='false'> |
|
|
|
</div> |
|
|
|
<button class="submit-btn" type="submit">Submit</button> |
|
|
|
<button @click="register($event)" class="submit-btn" type="submit">Submit</button> |
|
|
|
</form> |
|
|
|
<form v-if="active === 'forgot'" v-on:submit="forgotPassword" id="forgot-form"> |
|
|
|
<h3>Forgot Password</h3> |
|
|
@@ -71,6 +71,8 @@ function getToken() { |
|
|
|
} |
|
|
|
function register(event) { |
|
|
|
/* this.active = 'loading' */ |
|
|
|
event.preventDefault(); |
|
|
|
event.stopPropagation(); |
|
|
|
this.getToken().then(() => {fetch("/register", { |
|
|
|
method: 'POST', |
|
|
|
headers: {'Content-Type': 'application/json', |
|
|
@@ -96,9 +98,8 @@ function getToken() { |
|
|
|
} |
|
|
|
/* console.log(response.json()) */ |
|
|
|
}); |
|
|
|
event.preventDefault(); |
|
|
|
event.stopPropagation(); |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
function checkPasswords() { |
|
|
|