Start of auth switching. My god it's a mess