Spaces:
Runtime error
Runtime error
Download TaskTrackingSystem.WebApp/Components/RedirectToLogin.razor from Yuruyuruu/task-tracking-system: direct link, hf CLI and curl.
- Browser
- Download file 736 Bytes
-
https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.WebApp/Components/RedirectToLogin.razor
- Command line
-
hf download hf://spaces/Yuruyuruu/task-tracking-system/TaskTrackingSystem.WebApp/Components/RedirectToLogin.razor
-
curl -L -o RedirectToLogin.razor https://huggingface.co/spaces/Yuruyuruu/task-tracking-system/resolve/main/TaskTrackingSystem.WebApp/Components/RedirectToLogin.razor
736 Bytes
| NavigationManager Navigation | |
| AuthenticationStateProvider AuthStateProvider | |
| { | |
| protected override async Task OnAfterRenderAsync(bool firstRender) | |
| { | |
| if (!firstRender) | |
| { | |
| return; | |
| } | |
| var authState = await AuthStateProvider.GetAuthenticationStateAsync(); | |
| if (authState.User.Identity?.IsAuthenticated == true) | |
| { | |
| return; | |
| } | |
| var path = new Uri(Navigation.Uri).AbsolutePath; | |
| if (path.Equals("/login", StringComparison.OrdinalIgnoreCase)) | |
| { | |
| return; | |
| } | |
| var returnUrl = Uri.EscapeDataString(path); | |
| Navigation.NavigateTo($"/login?ReturnUrl={returnUrl}", forceLoad: true); | |
| } | |
| } | |