So, i managed to achieve what i want by directing the exisiting window.location.href to a newly created php file i put in the root called .login.php. I will share the code below as it handles the user roles nicely when logging in using this jquery method
.login.php
<?php
require_once('wp-load.php');
function user_role_check_modal( $role, $user_id = null ) {
$user = wp_get_current_user();
if ( empty( $user ) )
return false;
return in_array( $role, (array) $user->roles );
}
if ( user_role_check_modal( 'administrator' )):
header("Location: /wp-admin/");
exit();
endif;
if ( user_role_check_modal( 'customer' )):
header("Location: /my-account/");
exit();
else:
header("Location: /my-account/");
exit();
endif;
Hope this helps someone who maybe in the future needs work around