1
1
using Finbuckle . MultiTenant . Abstractions ;
2
+ using FSH . Framework . Core . Origin ;
2
3
using FSH . Framework . Core . Persistence ;
3
4
using FSH . Framework . Core . Tenant ;
4
5
using FSH . Framework . Infrastructure . Identity . RoleClaims ;
9
10
using Microsoft . AspNetCore . Identity ;
10
11
using Microsoft . EntityFrameworkCore ;
11
12
using Microsoft . Extensions . Logging ;
13
+ using Microsoft . Extensions . Options ;
12
14
13
15
namespace FSH . Framework . Infrastructure . Identity . Persistence ;
14
16
internal sealed class IdentityDbInitializer (
@@ -17,7 +19,8 @@ internal sealed class IdentityDbInitializer(
17
19
RoleManager < FshRole > roleManager ,
18
20
UserManager < FshUser > userManager ,
19
21
TimeProvider timeProvider ,
20
- IMultiTenantContextAccessor < FshTenantInfo > multiTenantContextAccessor ) : IDbInitializer
22
+ IMultiTenantContextAccessor < FshTenantInfo > multiTenantContextAccessor ,
23
+ IOptions < OriginOptions > originSettings ) : IDbInitializer
21
24
{
22
25
public async Task MigrateAsync ( CancellationToken cancellationToken )
23
26
{
@@ -113,7 +116,7 @@ private async Task SeedAdminUserAsync()
113
116
PhoneNumberConfirmed = true ,
114
117
NormalizedEmail = multiTenantContextAccessor . MultiTenantContext . TenantInfo ? . AdminEmail ! . ToUpperInvariant ( ) ,
115
118
NormalizedUserName = adminUserName . ToUpperInvariant ( ) ,
116
- ImageUrl = new Uri ( IdentityConstants . DefaultProfilePicture ) ,
119
+ ImageUrl = new Uri ( originSettings . Value . OriginUrl ! + IdentityConstants . DefaultProfilePicture ) ,
117
120
IsActive = true
118
121
} ;
119
122
0 commit comments