Redirect to other page if login

Add below code in your functions.php file of active theme directory in order to restrict the login page to logged-in users and redirect them to core user page (user profile). You can replace “um_get_core_page( ‘user’ )” with any page URL where you want to redirect logged-in users.

/* Restrict Login page to logged-in users and redirect to core user page (user profile) */
add_action( 'template_redirect', 'um_restrict_login_page_logged_in' );
function um_restrict_login_page_logged_in() {
    if ( um_is_core_page('login') && is_user_logged_in() ) {
        wp_redirect( um_get_core_page( 'user' ) );

Hope this works!!