Implemented redirection after successful login/register.