Initial Spark Install
This commit is contained in:
25
spark/resources/assets/js/settings/security/disable-two-factor-auth.js
vendored
Normal file
25
spark/resources/assets/js/settings/security/disable-two-factor-auth.js
vendored
Normal 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');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
39
spark/resources/assets/js/settings/security/enable-two-factor-auth.js
vendored
Normal file
39
spark/resources/assets/js/settings/security/enable-two-factor-auth.js
vendored
Normal 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');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
24
spark/resources/assets/js/settings/security/update-password.js
vendored
Normal file
24
spark/resources/assets/js/settings/security/update-password.js
vendored
Normal 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);
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user