♻️ Refined custom apps
This commit is contained in:
@ -197,30 +197,6 @@ public class AppDatabase(
|
||||
.HasIndex(p => p.SearchVector)
|
||||
.HasMethod("GIN");
|
||||
|
||||
modelBuilder.Entity<CustomApp>()
|
||||
.Property(c => c.RedirectUris)
|
||||
.HasConversion(
|
||||
v => string.Join(",", v),
|
||||
v => v.Split(",", StringSplitOptions.RemoveEmptyEntries).ToArray());
|
||||
|
||||
modelBuilder.Entity<CustomApp>()
|
||||
.Property(c => c.PostLogoutRedirectUris)
|
||||
.HasConversion(
|
||||
v => v != null ? string.Join(",", v) : "",
|
||||
v => !string.IsNullOrEmpty(v) ? v.Split(",", StringSplitOptions.RemoveEmptyEntries) : Array.Empty<string>());
|
||||
|
||||
modelBuilder.Entity<CustomApp>()
|
||||
.Property(c => c.AllowedScopes)
|
||||
.HasConversion(
|
||||
v => v != null ? string.Join(" ", v) : "",
|
||||
v => !string.IsNullOrEmpty(v) ? v.Split(" ", StringSplitOptions.RemoveEmptyEntries) : new[] { "openid", "profile", "email" });
|
||||
|
||||
modelBuilder.Entity<CustomApp>()
|
||||
.Property(c => c.AllowedGrantTypes)
|
||||
.HasConversion(
|
||||
v => v != null ? string.Join(" ", v) : "",
|
||||
v => !string.IsNullOrEmpty(v) ? v.Split(" ", StringSplitOptions.RemoveEmptyEntries) : new[] { "authorization_code", "refresh_token" });
|
||||
|
||||
modelBuilder.Entity<CustomAppSecret>()
|
||||
.HasIndex(s => s.Secret)
|
||||
.IsUnique();
|
||||
|
Reference in New Issue
Block a user