Tweaked auth code some more, seems to be working...