WIP: ensureAuthenticated middleware / logout