server/src/Entity/authentication.js
/**
    * Method to validate the password change token and change the password.
    * @param token: The token of the user.
    * @returns {Promise<unknown>}
    */
Method to validate the password change token and change the password.
@param token: The token of the user.
@returns {Promise}
Method to validate the password change token and change the password . @param token : The token of the user . @returns { Promise }
validateTokenAndChangePassword(token) {
      return new Promise((resolve, reject) => {
         database.runSp(constants.SP_GENERATE_AND_VALIDATE_PASSWORD_TOKEN, [this._emailId, token, 1, this._password])
            .then(_resultSet => {
               const result = _resultSet[0][0];
               if (validators.validateUndefined(result)) {
                  resolve(result);
               } else {
                  resolve({id: -1});
               }
            }).catch(err => {
            reject(err);
         });
      });
   }
validateTokenAndChangePassword ( token ) { return new Promise ( ( resolve , reject ) => { database . runSp ( constants . SP_GENERATE_AND_VALIDATE_PASSWORD_TOKEN , [ this . _emailId , token , 1 , this . _password ] ) . then ( _resultSet => { const result = _resultSet [ 0 ] [ 0 ] ; if ( validators . validateUndefined ( result ) ) { resolve ( result ) ; } else { resolve ( { id : - 1 } ) ; } } ) . catch ( err => { reject ( err ) ; } ) ; } ) ; }
Method to validate the password change token and change the password.
Method to validate the password change token and change the password .