Finish authentication middleware