Authentication error not setting attribute