diff --git a/frontend/src/js/controllers/profileCtrl.js b/frontend/src/js/controllers/profileCtrl.js
index 2395d90480..5545f14cda 100644
--- a/frontend/src/js/controllers/profileCtrl.js
+++ b/frontend/src/js/controllers/profileCtrl.js
@@ -354,6 +354,32 @@
$rootScope.notify("error", "Something went wrong! Please refresh the page and try again.");
}
};
+
+ // Deactivate User Account
+ vm.confirmDeactivateAccount = function(deactivateAccountForm) {
+ if (deactivateAccountForm) {
+ parameters.token = userKey;
+ parameters.method = 'POST';
+ parameters.url = 'accounts/user/disable';
+ parameters.callback = {
+ onSuccess: function(response) {
+ var status = response.status;
+ if (status == 200) {
+ utilities.resetStorage();
+ $rootScope.isLoader = false;
+ $state.go("home");
+ $rootScope.isAuth = false;
+ $rootScope.notify("success", "Your account has been deactivated successfully.");
+ }
+ },
+ onError: function(response) {
+ var details = response.data;
+ $rootScope.notify("error", details.error);
+ }
+ };
+ utilities.sendRequest(parameters);
+ }
+ };
}
})();
diff --git a/frontend/src/js/route-config/route-config.js b/frontend/src/js/route-config/route-config.js
index 38fa1340f8..5f7b07729f 100644
--- a/frontend/src/js/route-config/route-config.js
+++ b/frontend/src/js/route-config/route-config.js
@@ -397,6 +397,15 @@
authenticate: true
};
+ var deactivate_account = {
+ name: "web.profile.deactivate-account",
+ parent: "web.profile",
+ url: "/deactivate-account",
+ templateUrl: baseUrl + "/web/profile/edit-profile/deactivate-account.html",
+ title: 'Deactivate Account',
+ authenticate: true
+ };
+
var host_challenge = {
name: "web.host-challenge",
parent: "web",
@@ -617,6 +626,7 @@
$stateProvider.state(our_team);
$stateProvider.state(get_involved);
$stateProvider.state(edit_profile);
+ $stateProvider.state(deactivate_account);
$stateProvider.state(contact_us);
$stateProvider.state(challengeInvitation);
$stateProvider.state(get_submission_related_files);
diff --git a/frontend/src/views/web/profile/edit-profile/deactivate-account.html b/frontend/src/views/web/profile/edit-profile/deactivate-account.html
new file mode 100644
index 0000000000..f6ae38c1aa
--- /dev/null
+++ b/frontend/src/views/web/profile/edit-profile/deactivate-account.html
@@ -0,0 +1,25 @@
+