add lastmodified and lastmodifiedid to table also add code for modified and create
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user