giving stream access to user
adding support for logging out