Skip to main content

Redirect user to a custom url after logged in

I'm using "Passwordless Login with OTP / SMS & Email - Facebook Account Kit" for login.

I want to redirect user to "http://www.domain.com/author//?screen=new" after they log in

this is the code I used

$current_user = wp_get_current_user();
    if ( is_user_logged_in() ) {
    $redirect = ('http://www.domain.com/author/'.$current_user->user_login.'/?screen=new'); }

It redirect to "http://www.domain.com/author/?screen=new" without the username. can anyone help me with this