add lastmodified and lastmodifiedid to table also add code for modified and create

This commit is contained in:
Kham
2021-09-01 16:03:05 +10:00
parent c5ab17115d
commit cc276d4a17
25 changed files with 255 additions and 115 deletions
@@ -21,13 +21,13 @@ namespace CarParkValidationAPI.Authorization
public async Task Invoke(HttpContext context, IUserService userService, IJwtUtils jwtUtils)
{
var token = context.Request.Headers["Authorization"].FirstOrDefault()?.Split(" ").Last();
var userId = jwtUtils.ValidateJwtToken(token);
if (userId != null)
var user = jwtUtils.ValidateJwtToken(token);
if (user != null)
{
// attach user to context on successful jwt validation
//here to put in the real user
//TODO if you want to add information for User
// context.Items["User"] = userService.GetById(userId.Value);
context.Items["User"] = user;
}
await _next(context);