CAS middleware for Node