Authentication error handling fix

Signed-off-by: Ladislav Klenovic <klenovic@nerdrobot.net>