Updated router to allow authentication checks