Initial Spark Install

This commit is contained in:
Deon George
2017-11-03 16:26:07 +11:00
commit b1a5807eb3
766 changed files with 128896 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
module.exports = {
props: ['user'],
/**
* The component's data.
*/
data() {
return {
form: new SparkForm({})
}
},
methods: {
/**
* Disable two-factor authentication for the user.
*/
disable() {
Spark.delete('/settings/two-factor-auth', this.form)
.then(() => {
Bus.$emit('updateUser');
});
}
}
};

View File

@@ -0,0 +1,39 @@
module.exports = {
props: ['user'],
/**
* The component's data.
*/
data() {
return {
form: new SparkForm({
country_code: '',
phone: ''
})
}
},
/**
* Prepare the component.
*/
mounted() {
this.form.country_code = this.user.country_code;
this.form.phone = this.user.phone;
},
methods: {
/**
* Enable two-factor authentication for the user.
*/
enable() {
Spark.post('/settings/two-factor-auth', this.form)
.then(code => {
this.$parent.$emit('receivedTwoFactorResetCode', code);
Bus.$emit('updateUser');
});
}
}
};

View File

@@ -0,0 +1,24 @@
module.exports = {
/**
* The component's data.
*/
data() {
return {
form: new SparkForm({
current_password: '',
password: '',
password_confirmation: ''
})
};
},
methods: {
/**
* Update the user's password.
*/
update() {
Spark.put('/settings/password', this.form);
}
}
};