I am using the below code to execute when the page load. It is working fine. But. It is redirecting only when I logged the wordpress.
<script type="text/javascript">
window.onload = function(){
document.forms['form_signup'].submit();
}
</script>
<body>
<form name="form_signup" action="https://signnupformregister.com/login.php" method="POST">
<input type="hidden" id="pw" name="pw" value="pass@e"><br>
<input type="hidden" id="user" name="un" value="username@microsft.in"><br><br>
</form>
</body>
When I refresh the page after logout, login page only showing and hidden values not pass to the post URL.
This could be because of the plugins you added and the effect of their updates on the theme.
For instance, a security plugin may disable the REST-API option for users except for the admin.
You need to check the function.php and find the relevant authentication function there. Something similar to this condition (! is_user_logged_in()) then throw error if the users is not logged in.