diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-09-14 14:41:40 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-09-14 14:41:40 +1000 |
| commit | 604ef537e0fabfbcc3abf9d7473b22f08dc549a6 (patch) | |
| tree | e3ba3b1c54c245f10ca8b2abbc4fe24d648868f8 /Pages/Component | |
| parent | b3654a2764873cef9f171bb6ccd6726feae3e796 (diff) | |
Finalised login functionality
Diffstat (limited to 'Pages/Component')
| -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"; } |
