PacktPublishing / ASPdotNET-Core-and-Angular-2

Code Repository for ASP.NET Core and Angular 2, Published by Packt
MIT License
33 stars 17 forks source link

Can't login after password changing. #5

Closed SlavaUtesinov closed 7 years ago

SlavaUtesinov commented 7 years ago

It seems, that at JwtProvider class, user variable is cached due to DbContext lifecycle duration, so password remains the same, as it was at first login. Simple solution is to add DbContext.Entry(user).Reload(); after user initialization (at line 92).

Darkseal commented 7 years ago

Thank you for your valuable suggestion: I'm point here the readers who also experienced this issue. However, please take into account that the JwtProvider implementation suggested within the book should not be taken as "final" in any way: the book helps to build a potentially shippable product (milestone 1) which would always have to be refined (and also updated) later on.