Skip to content

Commit

Permalink
Merge pull request #50 from MOV-AI/bugfix/fix-reset-password
Browse files Browse the repository at this point in the history
Bugfix/fix reset password
  • Loading branch information
RianMartins-Movai authored Apr 5, 2022
2 parents 084e5fd + 95fed83 commit 1b839f8
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/User/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,27 @@ class User {
return Rest.post({ path: `v1/User/change-password/`, body });
};

/**
* Get authenticated username
* @returns {string} username
*/
getUsername = () => {
return this.tokenData?.message?.name;
};

//========================================================================================
/* *
* Static Methods *
* */
//========================================================================================

/**
* Reset user password
* @param {string} userId : userId to change password
* @param {{new_password: string, confirm_password: string}} body : Request body
* @returns {Promise} Response promise
*/
resetPassword = async body => {
const userId = this.tokenData.message.name;
static resetPassword = async (userId, body) => {
return Rest.post({ path: `v1/User/${userId}/reset-password/`, body });
};
}
Expand Down

0 comments on commit 1b839f8

Please sign in to comment.