From 0bed93d671766bd690e485c2522d92e87388431a Mon Sep 17 00:00:00 2001 From: Yaser Moradi Date: Wed, 5 Jun 2024 19:27:20 +0200 Subject: [PATCH] fix(templates): Fix change phone number issue in Boilerplate project template #7701 (#7702) --- .../Controllers/Identity/UserController.cs | 2 +- .../Components/Pages/Identity/SignUpPage.razor.cs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Boilerplate.Server/Controllers/Identity/UserController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Boilerplate.Server/Controllers/Identity/UserController.cs index 3cbd2457d9..65f0c29170 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Boilerplate.Server/Controllers/Identity/UserController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Boilerplate.Server/Controllers/Identity/UserController.cs @@ -137,7 +137,7 @@ public async Task SendChangePhoneNumberToken(SendPhoneTokenRequestDto request, C var token = await userManager.GenerateChangePhoneNumberTokenAsync(user!, request.PhoneNumber!); - await smsService.SendSms(Localizer[nameof(AppStrings.ChangePhoneNumberTokenSmsText), token], user.PhoneNumber!, cancellationToken); + await smsService.SendSms(Localizer[nameof(AppStrings.ChangePhoneNumberTokenSmsText), token], request.PhoneNumber!, cancellationToken); } [HttpPost] diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignUpPage.razor.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignUpPage.razor.cs index b6be180d3a..68fd765f77 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignUpPage.razor.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignUpPage.razor.cs @@ -9,13 +9,12 @@ public partial class SignUpPage private bool isWaiting; private string? message; private ElementReference messageRef = default!; - private readonly SignUpRequestDto signUpModel = new(); + private readonly SignUpRequestDto signUpModel = new() { UserName = Guid.NewGuid().ToString() }; [AutoInject] private ILocalHttpServer localHttpServer = default!; [AutoInject] private IIdentityController identityController = default!; - private async Task DoSignUp() { if (isWaiting) return; @@ -38,8 +37,6 @@ private async Task DoSignUp() try { - signUpModel.UserName = Guid.NewGuid().ToString(); // You can also bind the UserName property to an input - await identityController.SignUp(signUpModel, CurrentCancellationToken); var queryParams = new Dictionary();