Handle login state in frontend: redirecting/rendering.