Update Logout.razor (#190)

This commit is contained in:
Leendert de Borst
2024-12-23 17:11:30 +01:00
parent 4fb5087c82
commit 8edfc3d0d6

View File

@@ -22,14 +22,13 @@
await AuthLoggingService.LogAuthEventSuccessAsync(username!, AuthEventType.Logout);
// Redirect to the home page with hard refresh.
NavigationService.RedirectTo("/", true);
NavigationService.RedirectTo("./", true);
}
catch (Exception ex)
catch
{
// Hard refresh current page if sign out fails. When an interactive server session is already started
// the sign-out will fail because it tries to mutate cookies which is only possible when the server
// session is not started yet.
Console.WriteLine(ex);
await AuthLoggingService.LogAuthEventSuccessAsync(username!, AuthEventType.Logout);
NavigationService.RedirectTo(NavigationService.Uri, true);
}