mirror of https://github.com/abpframework/abp.git
13 changed files with 56 additions and 54 deletions
@ -0,0 +1,8 @@ |
|||||
|
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme; |
||||
|
|
||||
|
public class AuthenticationOptions |
||||
|
{ |
||||
|
public string LoginUrl { get; set; } = "authentication/login"; |
||||
|
|
||||
|
public string LogoutUrl { get; set; } = "authentication/logout"; |
||||
|
} |
||||
@ -1,17 +1,16 @@ |
|||||
@inject NavigationManager Navigation |
@inject NavigationManager Navigation |
||||
|
|
||||
@using Volo.Abp.DependencyInjection |
@using Volo.Abp.DependencyInjection |
||||
@using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic |
@using Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic |
||||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication |
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication |
||||
|
@using Microsoft.Extensions.Options |
||||
@inherits RedirectToLogin |
@inherits RedirectToLogin |
||||
@attribute [ExposeServices(typeof(RedirectToLogin))] |
@attribute [ExposeServices(typeof(RedirectToLogin))] |
||||
@attribute [Dependency(ReplaceServices = true)] |
@attribute [Dependency(ReplaceServices = true)] |
||||
|
@inject IOptions<AuthenticationOptions> AuthenticationOptions |
||||
|
|
||||
@code { |
@code { |
||||
|
|
||||
protected override void OnInitialized() |
protected override void OnInitialized() |
||||
{ |
{ |
||||
Navigation.NavigateToLogin("authentication/login"); |
Navigation.NavigateToLogin(AuthenticationOptions.Value.LoginUrl); |
||||
} |
} |
||||
|
} |
||||
} |
|
||||
|
|||||
Loading…
Reference in new issue