change check from user.identity.isauthenticated to request.isauthenticated