Fixed KeyError on authentication without username