updating authentication middleware based off sessioning