fixes requiresAuth and redirect