diff --git a/src/remote/security.cpp b/src/remote/security.cpp index c19c8e2..5838028 100644 --- a/src/remote/security.cpp +++ b/src/remote/security.cpp @@ -95,9 +95,15 @@ struct CAPlugin : public pva::AuthenticationPlugin { std::tr1::shared_ptr sess(new SimpleSession(user)); // no init data if(server) { - peer->identified = true; - peer->account = data->getSubFieldT("user")->get(); - peer->aux = pvd::getPVDataCreate()->createPVStructure(data); // clone to ensure it won't be modified + pvd::PVString::shared_pointer user; + if(data) + user = data->getSubField("user"); + + if(user) { + peer->account = user->get(); + peer->identified = !peer->account.empty(); + peer->aux = pvd::getPVDataCreate()->createPVStructure(data); // clone to ensure it won't be modified + } control->authenticationCompleted(pvd::Status::Ok, peer); } return sess;