Browse Source

Configure RedirectAllowedUrls

pull/10900/head
liangshiwei 5 years ago
parent
commit
a5eba2fa67
  1. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs
  2. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/appsettings.json

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/MyProjectNameBlazorModule.cs

@ -99,6 +99,7 @@ namespace MyCompanyName.MyProjectName.Blazor.Server
Configure<AppUrlOptions>(options => Configure<AppUrlOptions>(options =>
{ {
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"].Split(','));
}); });
} }

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/appsettings.json

@ -1,6 +1,7 @@
{ {
"App": { "App": {
"SelfUrl": "https://localhost:44313" "SelfUrl": "https://localhost:44313",
"RedirectAllowedUrls": "https://localhost:44313"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName;Trusted_Connection=True" "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName;Trusted_Connection=True"

Loading…
Cancel
Save