Skip to content

Commit 5b9b3cd

Browse files
committed
Fix
1 parent 29567ea commit 5b9b3cd

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Components/WebAssembly/WebAssembly.Authentication/src/NavigationManagerExtensions.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,19 @@ public static void NavigateToLogout(this NavigationManager manager, string logou
3232
/// <param name="returnUrl">The url to redirect the user to after logging out.</param>
3333
public static void NavigateToLogout(this NavigationManager manager, string logoutPath, string? returnUrl)
3434
{
35-
manager.NavigateTo(logoutPath, new NavigationOptions
35+
InteractiveRequestOptions? request = null;
36+
if (returnUrl != null)
3637
{
37-
HistoryEntryState = new InteractiveRequestOptions
38+
request = new InteractiveRequestOptions
3839
{
3940
Interaction = InteractionType.SignOut,
40-
ReturnUrl = returnUrl
41-
}.ToState()
41+
ReturnUrl = returnUrl!
42+
};
43+
}
44+
45+
manager.NavigateTo(logoutPath, new NavigationOptions
46+
{
47+
HistoryEntryState = request?.ToState()
4248
});
4349
}
4450

0 commit comments

Comments
 (0)