Try:
if (tokenResult.TryGetToken(out var token))
{
hubConnection = new HubConnectionBuilder()
.WithUrl("https://localhost:44388/my-messaging-hub", options =>
{
options.AccessTokenProvider = () => Task.FromResult(token.Value);
}).Build();
hubConnection.On<string>("MessageBackToBlazor", (message) =>
{
Console.WriteLine("Received message from server: " + message);
// Comes from Host
var encodedMsg = $"Message: {message}";
messages.Add(encodedMsg);
StateHasChanged();
});
await hubConnection.StartAsync();
await hubConnection.InvokeAsync("SendMessage", "Hello from Blazor!");
state = hubConnection.State.ToString();
}
Solved
HI,
join the meeting: https://zoom.us/j/99950578218?pwd=YTEzTG5Jb2ZQeWVwWWo0aUNGdlpWUT09
You can place breakpoints on Job handler classes for debugging.
When I use as a True, I can not push my message in RabbitMq.
Sorry, I didn't get it, I think the message is already handled by the job handler, so you can't see the ready message on the Rabbitmq website. it has been consumed
Hi,
Sorry, I thought you were using the latest version.
For version 4.4.3
public class MyRegisterModel : RegisterModel
{
......
[UnitOfWork]
public async override Task<IActionResult> OnPostAsync()
{
try
{
await CheckSelfRegistrationAsync();
await SetUseCaptchaAsync();
IdentityUser user;
if (IsExternalLogin)
{
var externalLoginInfo = await SignInManager.GetExternalLoginInfoAsync();
if (externalLoginInfo == null)
{
Logger.LogWarning("External login info is not available");
return RedirectToPage("./Login");
}
user = await RegisterExternalUserAsync(externalLoginInfo, Input.EmailAddress);
}
else
{
user = await RegisterLocalUserAsync();
}
if (await SettingProvider.IsTrueAsync(IdentitySettingNames.SignIn.RequireConfirmedEmail) && !user.EmailConfirmed ||
await SettingProvider.IsTrueAsync(IdentitySettingNames.SignIn.RequireConfirmedPhoneNumber) && !user.PhoneNumberConfirmed)
{
await StoreConfirmUser(user);
return RedirectToPage("./ConfirmUser", new
{
returnUrl = ReturnUrl,
returnUrlHash = ReturnUrlHash
});
}
await SignInManager.SignInAsync(user, isPersistent: true);
// this line
return Redirect("the URL what you want to redirect");
}
catch (BusinessException e)
{
Alerts.Danger(GetLocalizeExceptionMessage(e));
return Page();
}
}
}
Hi,
You can try it first, I think it should be easy to do.