server-side identity middleware for node