Updated logout functionality to be part of requireAuthentication class.