Wrote some more auth code