Redirect after POST processing

I’m working with a third party that redirect a user to a page of my application with a POST variable, I have to show to the user a page while I process the request and the redirect that user back to the third party.

I’m using Iron Router so I get the POST data with a Route in the server side:

Router.route('/webpay/notify', function() {
   var body = this.request.body;
   var response = this.response;
   Meteor.call ... 
   response.end('<html>...</html>');
 });
 }, {where: 'server'});

My problem is how can I redirect the user to an external url after that I process the request, taking in consideration that I have to show the user a page while (s)he is waiting.

Any ideas? please?

Did you find your answer ? Could you share it ? Thanks ! :slight_smile:

Hi, I ended up taking a variable and condition inside the template and redirecting from there with a Router.go.

Depending on what you want yo can use a timeout or a condition to do the redirection.

I don´t know if this is the best solution but it´s working.