add a login status check on client side.