ASP.NET Zero 10.2 Angular 10/.NET Core 5
Earlier today upon testing it for the first time in my application, I discovered that 2FA is not working. The exception “Security code cannot be sent!” is being thrown by TokenAuthController due to the CacheItem being null after the call to the CacheManager. Upon researching this I discovered that the problem was originally reported earlier this year on a 10. 0 Angular/Core solution (https://support.aspnetzero.com/QA/Questions/9970/Two-factor-code-caching). The problem was acknowledged as a bug and supposedly fixed in #3754 which was closed on February 2, 2021 to be included in 10. 5. It was recommended to the original submitter to apply the changes of #3754 to fix the problem on their 10 solution. I just carefully applied those changes myself to my 10. 2 solution, but it has not corrected the problem so far of the null CacheItem.
I see there was some backtracking of earlier changes in the final commit. It appeared to me that the final change set in #3754 was incomplete or invalid as there was an import added into the send-two-factor-code.component.ts for the validate-two-factor-code.component.ts, but is unreferenced and unused there. It was used and an earlier change set that was backtracked. I don't if I have something wrong or not, but I think the solution that was posted in GitHub is incomplete or confusing at least. I really need to get this working ASAP without spending a lot more additional time on it. I have attached Git diff screenshots of all my changes. What is wrong or missing? Is there anything else I need to do or specific ways to test this while running in my development environment? My app logs in fine with 2FA disabled and these changes below in effect. Thank you.