cornflourblue / aspnet-core-3-signup-verification-api

ASP.NET Core 3.1 - Boilerplate API with Email Sign Up, Verification, Authentication & Forgot Password
https://jasonwatmore.com/post/2020/07/06/aspnet-core-3-boilerplate-api-with-email-sign-up-verification-authentication-forgot-password
MIT License
226 stars 93 forks source link

context.Items["Account"] on every validation #12

Open geekz-reno opened 3 years ago

geekz-reno commented 3 years ago

Just curious, why we must always call context.Items["Account"] = await dataContext.Accounts.FindAsync(accountId); on every request? i mean it always try calling to database on every call to protected route? can we use claims to achieve that?

jaybo commented 3 years ago

Here's an example of embedding claims into the jwt: https://dotnetcoretutorials.com/2020/01/15/creating-and-validating-jwt-tokens-in-asp-net-core/