diff --git a/src/js/client.js b/src/js/client.js index acdea3401..34664b85b 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -1873,8 +1873,17 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; - Client.prototype.sendPasswordReset = function (identifier, callback) { - post('/api/v1/cloudron/password_reset_request', { identifier }, null, function (error, data, status) { + Client.prototype.getPasswordResetLink = function (userId, callback) { + get('/api/v1/users/' + userId + '/password_reset_link', null, function (error, data, status) { + if (error) return callback(error); + if (status !== 200) return callback(new ClientError(status, data)); + + callback(null, data); + }); + }; + + Client.prototype.sendPasswordResetEmail = function (userId, email, callback) { + post('/api/v1/users/' + userId + '/send_password_reset_email', { email }, null, function (error, data, status) { if (error) return callback(error); if (status !== 202) return callback(new ClientError(status, data)); diff --git a/src/translation/en.json b/src/translation/en.json index 892cb2450..b3d40dbd9 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -285,7 +285,10 @@ "2FAIsSetup": "Use this to disable user's 2FA. The user can set it up again from the Profile view.", "newLinkAction": "Email reset link", "resetLinkExplanation": "Use this to email a password reset link to the user's fallback email address - {{ email }}.", - "reset2FAAction": "Reset 2FA" + "reset2FAAction": "Reset 2FA", + "sendAction": "Send", + "descriptionLink": "Password reset link for forwarding to the user", + "descriptionEmail": "Send password reset link to" }, "externalLdapDialog": { "title": "Configure LDAP" diff --git a/src/views/users.html b/src/views/users.html index b6209c338..1833f0a6a 100644 --- a/src/views/users.html +++ b/src/views/users.html @@ -341,23 +341,32 @@