Modified endpoint protector to redirect to index if logged in