tugberkugurlu / AspNet.Identity.RavenDB

Fully asynchronous, new and sweet ASP.NET Identity implementation for RavenDB
MIT License
42 stars 28 forks source link

User data not being refreshed from database #44

Closed spapaseit closed 8 years ago

spapaseit commented 8 years ago

You probably haven't used or seen this code in a while, but I have the following issue:

I login with a user that has an "admin" role Claim

"Claims": [
    {
         "ClaimType": "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
         "ClaimValue": "admin"
     }
 ],

And everything works fine. But to try and test of the roles are properly set up, I change the ClaimValue to "admin2" in de database. When logging in I would expect to get a 401 unauthorised response, but instead I see that the user being fetched from the Document Store still has the old ClaimValue of "admin".

Any ideas on why the user is not being refreshed?

Update

I grabbed the source code and changed RavenUserStore so that i opens a new IAsyncSession every time FindByNameAsync is called, and that does fetch the user data anew. Just mentioning in case it helps you to point me in the right direction

spapaseit commented 8 years ago

Sorry, I was initializing the Document Session through a Factory and not using a using statement... It's all good now :)