Yikes, that authentication bug

I have no idea who the original source of this bug was.  We imported
the code as-is from an abandoned BitBucket repo.