Problem
Local WordPress site redirects to production domain after login. This happens if home and siteurl in the database are overwritten with the production URL.
Navigate to the config file at app/public/wp-config.php
Above the /* That's all, stop editing! */ comment, add the following lines:
define('WP_HOME', 'http://localhost:10123');
define('WP_SITEURL', 'http://localhost:10123');
This stops redirects instantly and allows you to log in. Afterwards, you will need to fix the database manually or use a plugin (like Better Search & Replace) to swap your production URL with your localhost URL.
wp_optionshomesiteurlFor example:
http://localhost:10123
wp option update home 'http://localhost:10123'
wp option update siteurl 'http://localhost:10123'
WP_HOME / WP_SITEURL from wp-config.php