Usual redirecting wont work if modal is opened. So to do that you need some custom code like this will work for redirecting after loging in.
function custom_user_login(&$edit, $account) {
ctools_add_js('ajax-responder');
$commands = array();
$commands[] = ctools_ajax_command_redirect('first-time-login');
print ajax_render($commands);
exit;
}
There is also a Rules redirect action if you install Modal Forms module, that has redirect modal aware, you can check the code there or just use it if you use rules.