Corrige la deconnexion du compte joueur
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
<strong>@DisplayName</strong>
|
||||
<span>@DisplayMeta</span>
|
||||
</div>
|
||||
<button class="button ghost small" type="button" @onclick="LogoutAsync" disabled="@IsSubmitting">Se deconnecter</button>
|
||||
<a class="button ghost small" href="api/auth/logout/browser">Se deconnecter</a>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
@@ -89,7 +89,7 @@
|
||||
<strong>@DisplayName</strong>
|
||||
<span>@DisplayMeta</span>
|
||||
</div>
|
||||
<button class="button ghost small" type="button" @onclick="LogoutAsync" disabled="@IsSubmitting">Se deconnecter</button>
|
||||
<a class="button ghost small" href="api/auth/logout/browser">Se deconnecter</a>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
@@ -395,29 +395,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LogoutAsync()
|
||||
{
|
||||
if (IsSubmitting)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IsSubmitting = true;
|
||||
FormError = null;
|
||||
CloseMobileMenu();
|
||||
|
||||
try
|
||||
{
|
||||
await Http.PostAsync("api/auth/logout", null);
|
||||
AuthenticationStateProvider.SetAnonymous();
|
||||
await RefreshAuthenticationStateAsync();
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsSubmitting = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleAuthenticationStateChanged(Task<AuthenticationState> authenticationStateTask)
|
||||
=> _ = InvokeAsync(RefreshAuthenticationStateAsync);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user