diff options
Diffstat (limited to 'Pages/Component/Titlebar.razor')
| -rw-r--r-- | Pages/Component/Titlebar.razor | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Pages/Component/Titlebar.razor b/Pages/Component/Titlebar.razor index bcd5f61..1772519 100644 --- a/Pages/Component/Titlebar.razor +++ b/Pages/Component/Titlebar.razor @@ -1,7 +1,4 @@ -@inject IUserService userService -@inject NavigationManager navigationManager -@inject IJSRuntime jsRuntime -@inject AuthenticationStateProvider authStateProvider +@inject IJSRuntime jsRuntime <script suppress-error="BL9992"> async function login() { @@ -18,11 +15,7 @@ }); if(resp.ok) { - if(document.referrer) { - window.location.href = document.referrer; - } else { - window.location.href = '/'; - } + window.location.href = '/'; } else if(resp.status == 403) { var form = document.querySelector('form.login'); form.classList.remove('bad-login'); @@ -79,5 +72,10 @@ </AuthorizeView> @code { + [CascadingParameter] + public Task<AuthenticationState> AuthState { get; set; } + private AboutDialog aboutDialog; + + private string username => AuthState.GetAwaiter().GetResult().User.Identity?.Name ?? "fugg"; } |
