‘wp_login’ action hook not working with wp-login.php file

wp_login is fired in wp_signon after the user has successfully logged in.

That’s after submitting the login form, so obviously you can’t execute any JavaScript there. Of course you can still do something in PHP.

If you want to execute JavaScript after login, you need to find another hook.