diff --git a/src/js/client.js b/src/js/client.js index 4845be978..82e7eaba2 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -1845,16 +1845,12 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; - Client.prototype.sendPasswordReset = function (callback) { - var data = { - identifier: this._userInfo.email - }; - - post('/api/v1/cloudron/password_reset_request', data, null, function (error, data, status) { + Client.prototype.sendPasswordReset = function (identifier, callback) { + post('/api/v1/cloudron/password_reset_request', { identifier }, null, function (error, data, status) { if (error) return callback(error); if (status !== 202) return callback(new ClientError(status, data)); - callback(null); + callback(null, data); }); }; diff --git a/src/translation/en.json b/src/translation/en.json index e047799ab..10ef96271 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -168,7 +168,7 @@ "inactiveTooltip": "User is inactive", "externalLdapTooltip": "From external LDAP directory", "notActivatedYetTooltip": "User is not activated yet", - "resetPasswordTooltip": "Reset password, disable 2FA or send invite link", + "resetPasswordTooltip": "Reset password", "editUserTooltip": "Edit User", "removeUserTooltip": "Remove User", "transferOwnershipTooltip": "Transfer Ownership" @@ -273,14 +273,14 @@ "deleteAction": "Delete" }, "passwordResetDialog": { - "title": "Password/2FA reset for {{ username }}", - "description": "Use the link below to reset {{ username }}'s password or re-invite:", + "title": "Reset password for {{ username }}", + "description": "The following password reset link was sent to {{ email }}:", "sendEmailLinkAction": "Email link to user", "emailSent": "Sent", "no2FASetup": "This user has not set up 2FA.", "2FAIsSetup": "Use this to disable user's 2FA. The user can set it up again from the Profile view.", - "newLinkAction": "Generate new link", - "resetLinkExplanation": "Use this to generate a password reset or invitation link. The new link will invalidate any old link immediately.", + "newLinkAction": "Reset password now", + "resetLinkExplanation": "Use this to generate a new password reset link. The new link will also be sent to the user's fallback email address.", "reset2FAAction": "Reset 2FA" }, "externalLdapDialog": { diff --git a/src/views/profile.js b/src/views/profile.js index 85a426779..09e651259 100644 --- a/src/views/profile.js +++ b/src/views/profile.js @@ -18,7 +18,7 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans }); $scope.sendPasswordReset = function () { - Client.sendPasswordReset(function (error) { + Client.sendPasswordReset($scope.user.email, function (error) { if (error) return console.error('Failed to reset password:', error); Client.notify($translate.instant('profile.passwordResetNotification.title'), $translate.instant('profile.passwordResetNotification.body', { email: $scope.user.fallbackEmail}), false, 'success'); diff --git a/src/views/users.html b/src/views/users.html index c1483b55f..e96cb3881 100644 --- a/src/views/users.html +++ b/src/views/users.html @@ -321,34 +321,26 @@ - -