Build Auth factory to check login on each page