How to capture a query parameter from a redirect URL after a POST request?

How about if you go into your Postman settings and disable “Automatically follow redirects” in the general tab under headers.

Also this topic might be of use.

Pre-request script to automate authorization code grant type - Ask the Experts and Postman Tips - Postman Community