rbugh
This commit is contained in:
parent
190d716366
commit
fbb392188c
|
|
@ -38,10 +38,6 @@ class RegisterController extends Controller
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->middleware('guest');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a validator for an incoming registration request.
|
* Get a validator for an incoming registration request.
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export function CreateAccount(form)
|
||||||
var badInputs = [];
|
var badInputs = [];
|
||||||
|
|
||||||
return new Promise(async (resolve, reject)=>{
|
return new Promise(async (resolve, reject)=>{
|
||||||
await axios.post(`${protocol}apis.${url}/account/register`, body, {headers: {'X-CSRF-TOKEN': document.querySelector(`meta[name="csrf-token"]`).content, "X-Requested-With":"XMLHttpRequest"}}).then(data=>{
|
await axios.post(`${protocol}apis.${url}/account/register`, body, {headers: {'X-CSRF-TOKEN': document.querySelector(`meta[name="csrf-token"]`).content, "X-Requested-With":"XMLHttpRequest", "accept":"application/json"}}).then(data=>{
|
||||||
const res = data.data;
|
const res = data.data;
|
||||||
if (res.badInputs.length >= 1) {
|
if (res.badInputs.length >= 1) {
|
||||||
badInputs=res.badInputs;
|
badInputs=res.badInputs;
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ const RegisterForm = (props) => {
|
||||||
if (res != `good`) {
|
if (res != `good`) {
|
||||||
setValidity({error: true, message:res.message, inputs: res.inputs});
|
setValidity({error: true, message:res.message, inputs: res.inputs});
|
||||||
setTimeout(()=>{setValidity({...validity, error: false, inputs: res.inputs});}, 4000);
|
setTimeout(()=>{setValidity({...validity, error: false, inputs: res.inputs});}, 4000);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
window.location.replace(`/home`);
|
window.location.replace(`/home`);
|
||||||
}).catch(error=>console.log(error));
|
}).catch(error=>console.log(error));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue