last error is persisted for the authentication

Fixes the issue #3