mirror of
https://github.com/bitwarden/server
synced 2026-01-06 10:34:01 +00:00
refactored data storage to use cipher table. added history table and insert triggers.
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Bit.Core.Identity
|
||||
var signInManager = context.HttpContext.RequestServices.GetRequiredService<JwtBearerSignInManager>();
|
||||
|
||||
var userId = userManager.GetUserId(context.Ticket.Principal);
|
||||
var user = await userRepository.GetByIdAsync(userId);
|
||||
var user = await userRepository.GetByIdAsync(new Guid(userId));
|
||||
|
||||
// validate security token
|
||||
if(!await signInManager.ValidateSecurityStampAsync(user, context.Ticket.Principal))
|
||||
|
||||
@@ -55,12 +55,14 @@ namespace Bit.Core.Identity
|
||||
|
||||
public async Task<User> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
if(_currentContext?.User != null && _currentContext.User.Id == userId)
|
||||
var id = new Guid(userId);
|
||||
|
||||
if(_currentContext?.User != null && _currentContext.User.Id == id)
|
||||
{
|
||||
return _currentContext.User;
|
||||
}
|
||||
|
||||
return await _userRepository.GetByIdAsync(userId);
|
||||
return await _userRepository.GetByIdAsync(id);
|
||||
}
|
||||
|
||||
public async Task<User> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = default(CancellationToken))
|
||||
@@ -100,7 +102,7 @@ namespace Bit.Core.Identity
|
||||
|
||||
public Task<string> GetUserIdAsync(User user, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return Task.FromResult(user.Id);
|
||||
return Task.FromResult(user.Id.ToString());
|
||||
}
|
||||
|
||||
public Task<string> GetUserNameAsync(User user, CancellationToken cancellationToken = default(CancellationToken))
|
||||
|
||||
Reference in New Issue
Block a user