add authentication back to middleware