fixed bug, eraseCredentials was removing user credentials before persisting user to DB, so user could not log in again