Ensure default reading profile is created
This commit is contained in:
parent
188020597c
commit
9f94abe1be
1 changed files with 11 additions and 0 deletions
|
@ -127,6 +127,7 @@ public class OidcService(ILogger<OidcService> logger, UserManager<AppUser> userM
|
|||
}
|
||||
|
||||
AddDefaultStreamsToUser(user, mapper);
|
||||
await AddDefaultReadingProfileToUser(user);
|
||||
|
||||
if (settings.RequireVerifiedEmail)
|
||||
{
|
||||
|
@ -223,4 +224,14 @@ public class OidcService(ILogger<OidcService> logger, UserManager<AppUser> userM
|
|||
user.SideNavStreams.Add(stream);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task AddDefaultReadingProfileToUser(AppUser user)
|
||||
{
|
||||
var profile = new AppUserReadingProfileBuilder(user.Id)
|
||||
.WithName("Default Profile")
|
||||
.WithKind(ReadingProfileKind.Default)
|
||||
.Build();
|
||||
unitOfWork.AppUserReadingProfileRepository.Add(profile);
|
||||
await unitOfWork.CommitAsync();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue