Ensure side nav streams aren't duplicated in sync
This commit is contained in:
parent
4c0faa755d
commit
7847ce4c1b
3 changed files with 10 additions and 2 deletions
|
@ -80,7 +80,7 @@ public class AccountController : BaseApiController
|
|||
[HttpGet]
|
||||
public async Task<ActionResult<UserDto>> GetCurrentUserAsync()
|
||||
{
|
||||
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(User.GetUserId(), AppUserIncludes.UserPreferences);
|
||||
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(User.GetUserId(), AppUserIncludes.UserPreferences | AppUserIncludes.SideNavStreams);
|
||||
if (user == null) throw new UnauthorizedAccessException();
|
||||
|
||||
var oidcSettings = (await _unitOfWork.SettingsRepository.GetSettingsDtoAsync()).OidcConfig;
|
||||
|
|
|
@ -31,6 +31,14 @@ public interface IAccountService
|
|||
Task<bool> HasDownloadPermission(AppUser? user);
|
||||
Task<bool> CanChangeAgeRestriction(AppUser? user);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <param name="librariesIds"></param>
|
||||
/// <param name="hasAdminRole"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>Ensure that the users SideNavStreams are loaded</remarks>
|
||||
Task UpdateLibrariesForUser(AppUser user, IList<int> librariesIds, bool hasAdminRole);
|
||||
Task<IEnumerable<IdentityError>> UpdateRolesForUser(AppUser user, IList<string> roles);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class OidcService(ILogger<OidcService> logger, UserManager<AppUser> userM
|
|||
throw new KavitaException("errors.oidc.email-not-verified");
|
||||
|
||||
|
||||
user = await unitOfWork.UserRepository.GetUserByEmailAsync(email, AppUserIncludes.UserPreferences)
|
||||
user = await unitOfWork.UserRepository.GetUserByEmailAsync(email, AppUserIncludes.UserPreferences | AppUserIncludes.SideNavStreams)
|
||||
?? await NewUserFromOpenIdConnect(settings, principal);
|
||||
if (user == null) return null;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue