Stuck in redirect loop after using wp_login action

After a lot of messing around it turned out that the culprit was the plugin WPML. I’m sketchy on the exact reasons as to why it caused the redirect loop, but it had to do with some unusual settings I was using because I was trying to work around another WPML problem.

In other words editing the hook must have been a coincidence.

I emptied the active_plugins record in the wp_options table so I could access the admin panel and change the settings before reverting. If you have to do this remember to save the old value somewhere for easy recovery.