[broken] Websockets authentication subsystem is partially refactored