|
|
@@ -24,7 +24,7 @@ |
|
|
|
</div> |
|
|
|
<button class="submit-btn" type="submit">Submit</button> |
|
|
|
</form> |
|
|
|
<form v-if="active === 'forgot'" v-on:submit="register" id="forgot-form"> |
|
|
|
<form v-if="active === 'forgot'" v-on:submit="forgotPassword" id="forgot-form"> |
|
|
|
<h3>Forgot Password</h3> |
|
|
|
<div> |
|
|
|
<label for='sender_email'>Email</label> |
|
|
@@ -93,6 +93,29 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function forgotPassword(event) { |
|
|
|
this.active = 'loading' |
|
|
|
fetch("/forgot-password", { |
|
|
|
method: 'POST', |
|
|
|
headers: {'Content-Type': 'application/json', |
|
|
|
'Accept': 'application/json', |
|
|
|
'X-XSRF-TOKEN': this.token}, |
|
|
|
body: JSON.stringify({"email": document.getElementById("forgot-email").value})}) |
|
|
|
.then(response => { |
|
|
|
//Give completed or error |
|
|
|
console.log(response.status) |
|
|
|
console.log(response.json()) |
|
|
|
if (response.ok) { |
|
|
|
this.active = 'forgot-completed' |
|
|
|
} else { |
|
|
|
this.error = response.status |
|
|
|
this.errorMessage = response.statusText |
|
|
|
this.active = 'error' |
|
|
|
} |
|
|
|
/* console.log(response.json()) */ |
|
|
|
}); |
|
|
|
event.preventDefault(); |
|
|
|
} |
|
|
|
|
|
|
|
module.exports = { |
|
|
|
data() { |
|
|
@@ -101,6 +124,7 @@ |
|
|
|
methods: { |
|
|
|
register, |
|
|
|
checkPasswords, |
|
|
|
forgotPassword, |
|
|
|
closeArea() { |
|
|
|
document.querySelector(".register-area").classList.remove("active") |
|
|
|
}, |
|
|
|