Set the error code when user authentication fail

Signed-off-by: Luciano Lima <lucianomlima@ymail.com>