You have a chicken and egg problem going. login_init is called PRIOR to the user actually logged in. It just indicates with the login page has been displayed.
(https://developer.wordpress.org/reference/hooks/login_init/)
The hook should be: wp_login. This fires after a user has successfully logged-in.
https://developer.wordpress.org/reference/hooks/wp_login/
add_action('wp_login', 'redirect_logged_in_users');
Related Posts:
- Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
- SSO / authentication integration with external ‘directory service’
- Preventing session timeout
- Check for correct username on custom login form
- ‘Password field is empty’ error when using autofill in Chrome
- wp_signon returns user, but the user is not logged in
- Prevent wp_login_form() from redirecting to wp-admin when there are errors
- How to disable autocomplete on the wp-login.php page
- how to display the wordpress login and register forms on a page?
- How to remove the WordPress logo from login and register page?
- How can I add a custom script to footer of login page?
- My login form does not work
- Is it alright for two people to simultaneously be logged into a WP site as administrator?
- How do I turn off the ability to login?
- Give visitor access to password protected page/post via external script
- WordPress Login Footer URL
- moving server can not login
- Save last login date in global before change it?
- Get wordpress stored cookies for custom login
- How to get login data (session) outside WordPress?
- password protect individual pages
- Change register form action url
- Is back-end access not required for an app to post to my blog?
- Store brute-force IP addresses
- How do I make my site publicly viewable? Everything redirects to wp-admin
- How to create a private login page for admin.?
- WordPress Security – How to block alternative WordPress access
- Protecting WordPress login page
- Different homepage for logged in users
- How can I prevent my custom form from redirecting to wp-login?
- reset password link redirect to login page
- Deregister default wp-admin css on login screen only?
- disable site_url redirect in wp-login.php
- Forgot password needs to redirect from wp-login to a custom page
- SSO to WP, from a non-wp site on a different domain and server
- How can I login as admin after redirect to custom login page
- Login with serialized password
- is_user_logged_in() not working in Firefox
- Why would the login page reload indefinitely?
- Set Default User Role
- Creating custom login errors
- Lock out all WordPress Administrators except two specific users
- Removing wordpress cookie from non-wordpress site
- Why is wp-login trying to send an email?
- Replacing default display name to login name
- Why does is_user_logged_in() return false after I change user password on the front end?
- How to generate “WP_Error” Object for user login?
- ?login=failed only attached to URL under certain circumstances
- I cannot login and am getting this error message. .
- Can I Get User ID at Login?
- Cannot log into migrated site
- I can’t access my WordPress dashboard – shows Warning message [closed]
- WordPress SSL not working [closed]
- I want login using email not username wordpress front end
- How to Remove default “Login” link
- How to unpublish my new site while working on it?
- SQL – Remove All The Users and Create A New User With Admin Role Via PhpMyAdmin
- Can I protect a type of content site-wide with a single password?
- How to force “remember me” users to login again?
- Reset Password Limit not working
- User not able to sign in after wp_authenticate() and wp_signon() wordpress
- WordPress site login Redirect
- Thank You Page Layout Differs on User Logged In Status
- On Homepage “is_user_logged_in()” function is not working after login and it is working after refresh the page?
- Problem in auto login after registration
- Problem with is_user_logged_in() function in some pages
- Cant reset password my wordpress password not even with phpMyAdmin
- Get WordPress logged in username from root domain when WP is installed in a subfolder
- How to invalidate `password reset key` after being used
- wp-cron event doesn’t run when custom login API is enabled
- Does it make sense to check a nonce on user log in?
- Special link for no automatic login (no username and no password)
- Global login to password protected pages
- Disable / Remove Password for Login WordPress
- WordPress Auto Login From Email Link
- Building a custom login form – encountering issues
- Making sure two different wordpress website has auto login
- Android app – can’t login: “This site already exists in the app, you can’t add it”
- Site login failed due to strange warning
- How do i Redirect specific user(WooCommerce Sign-in not wordpress admin page sign-in) to specific page
- Chosen user password in registration is not being accepted on Login
- Improvements to “limit login attempts” plugin
- Add a required field to Registration
- loging to Admin page not working at all
- Can’t login through wp-login.php on fresh installation
- WordPress Cookies – wp_set_auth_cookie
- Authenticate return value
- Enqueue script on logon failure
- I get 404 when I try to login ever since I changed the permalink
- Front-end login problem: requires re-authorization when accessing dashboard
- Using wp_login_form passowrd as undefined
- Redirect non-members to about/intro page
- When trying to login if already logged in, form just shakes – error message remains empty
- Handle POST request sent from an external site for login?
- Unable to login after adding ReCaptacha without API key
- How to create an alternative login page that does not use any plugins?
- issue with my wp site after login
- How can I automatically change directory on ssh login?
- How to create a fully functional user registration in WordPress?
- How to remove without touching the pluggable.php the wordpress_logged_in cookie to show the username on login?