mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Added password confirmation when deleteing account (#7402)
This commit is contained in:
committed by
Matteo Pagliazzi
parent
e3c79fbdfa
commit
1a19c9d2a6
@@ -177,13 +177,16 @@ habitrpg.controller('SettingsCtrl',
|
||||
$rootScope.$state.go('tasks');
|
||||
}
|
||||
|
||||
$scope['delete'] = function(){
|
||||
$http['delete'](ApiUrl.get() + '/api/v3/user')
|
||||
.success(function(res, code){
|
||||
if (res.err) return alert(res.err);
|
||||
localStorage.clear();
|
||||
window.location.href = '/logout';
|
||||
});
|
||||
$scope['delete'] = function(password) {
|
||||
$http({
|
||||
url: ApiUrl.get() + '/api/v3/user',
|
||||
method: 'DELETE',
|
||||
data: {password: password},
|
||||
})
|
||||
.then(function(res, code) {
|
||||
localStorage.clear();
|
||||
window.location.href = '/logout';
|
||||
});
|
||||
}
|
||||
|
||||
$scope.enterCoupon = function(code) {
|
||||
|
||||
Reference in New Issue
Block a user