From b61957d77564290d813b7d5d84084ffa8fed3cca Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Fri, 3 Jan 2025 16:32:20 +0100 Subject: [PATCH 1/7] Apply Web OTP pattern to Boilerplate short sent messages (#9612) --- .../IdentityController.PhoneConfirmation.cs | 2 +- .../IdentityController.ResetPassword.cs | 5 +++-- .../Controllers/Identity/IdentityController.cs | 9 +++++---- .../Controllers/Identity/UserController.cs | 14 ++++++++------ .../src/Shared/Resources/AppStrings.fa.resx | 18 ++++++++++++------ .../src/Shared/Resources/AppStrings.nl.resx | 18 ++++++++++++------ .../src/Shared/Resources/AppStrings.resx | 18 ++++++++++++------ 7 files changed, 53 insertions(+), 31 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs index 1db25ddd3d..cd750ec47f 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs @@ -78,6 +78,6 @@ private async Task SendConfirmPhoneToken(User user, CancellationToken cancellati var phoneNumber = user.PhoneNumber!; var token = await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"VerifyPhoneNumber:{phoneNumber},{user.PhoneNumberTokenRequestedOn?.ToUniversalTime()}")); - await phoneService.SendSms(Localizer[nameof(AppStrings.ConfirmPhoneTokenSmsText), token], phoneNumber, cancellationToken); + await phoneService.SendSms(Localizer[nameof(AppStrings.ConfirmPhoneTokenSmsText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/], phoneNumber, cancellationToken); } } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs index 0b3614af31..72f4e2a090 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs @@ -45,13 +45,14 @@ public async Task SendResetPasswordToken(SendResetPasswordTokenRequestDto reques sendMessagesTasks.Add(emailService.SendResetPasswordToken(user, token, link, cancellationToken)); } - var message = Localizer[nameof(AppStrings.ResetPasswordTokenShortText), token].ToString(); if (await userManager.IsPhoneNumberConfirmedAsync(user)) { - sendMessagesTasks.Add(phoneService.SendSms(message, user.PhoneNumber!, cancellationToken)); + var smsMessage = Localizer[nameof(AppStrings.ResetPasswordTokenShortText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/].ToString(); + sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } + var message = Localizer[nameof(AppStrings.ResetPasswordTokenShortText), token].ToString(); //#if (signalR == true) sendMessagesTasks.Add(appHubContext.Clients.User(user.Id.ToString()).SendAsync(SignalREvents.SHOW_MESSAGE, message, cancellationToken)); //#endif diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs index d11bdb2eb0..f0e9095def 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs @@ -308,7 +308,8 @@ public async Task SendOtp(IdentityRequestDto request, string? returnUrl = null, if (await userManager.IsPhoneNumberConfirmedAsync(user)) { - var smsMessage = Localizer[nameof(AppStrings.OtpShortText), await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"Otp_Sms,{user.OtpRequestedOn?.ToUniversalTime()}"))].ToString(); + var token = await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"Otp_Sms,{user.OtpRequestedOn?.ToUniversalTime()}")); + var smsMessage = Localizer[nameof(AppStrings.OtpShortText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/].ToString(); sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } @@ -364,15 +365,15 @@ public async Task SendTwoFactorToken(SignInRequestDto request, CancellationToken sendMessagesTasks.Add(emailService.SendTwoFactorToken(user, token, cancellationToken)); } - var message = Localizer[nameof(AppStrings.TwoFactorTokenShortText), token].ToString(); - if (firstStepAuthenticationMethod != "Sms" && await userManager.IsPhoneNumberConfirmedAsync(user)) { - sendMessagesTasks.Add(phoneService.SendSms(message, user.PhoneNumber!, cancellationToken)); + var smsMessage = Localizer[nameof(AppStrings.TwoFactorTokenShortText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/].ToString(); + sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } if (firstStepAuthenticationMethod != "Push") { + var message = Localizer[nameof(AppStrings.TwoFactorTokenShortText), token].ToString(); //#if (signalR == true) sendMessagesTasks.Add(appHubContext.Clients.User(user.Id.ToString()).SendAsync(SignalREvents.SHOW_MESSAGE, message, cancellationToken)); //#endif diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs index 3db42bd079..15f4c34567 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs @@ -228,7 +228,7 @@ public async Task SendChangePhoneNumberToken(SendPhoneTokenRequestDto request, C var token = await userManager.GenerateChangePhoneNumberTokenAsync(user!, request.PhoneNumber!); - await phoneService.SendSms(Localizer[nameof(AppStrings.ChangePhoneNumberTokenSmsText), token], request.PhoneNumber!, cancellationToken); + await phoneService.SendSms(Localizer[nameof(AppStrings.ChangePhoneNumberTokenSmsText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/], request.PhoneNumber!, cancellationToken); } [HttpPost] @@ -388,16 +388,18 @@ public async Task SendElevatedAccessToken(CancellationToken cancellationToken) List sendMessagesTasks = []; - var messageText = Localizer[nameof(AppStrings.ElevatedAccessToken), token].ToString(); - if (await userManager.IsEmailConfirmedAsync(user)) + if (await userManager.IsPhoneNumberConfirmedAsync(user)) { - sendMessagesTasks.Add(emailService.SendElevatedAccessToken(user, token, cancellationToken)); + var smsMessage = Localizer[nameof(AppStrings.ElevatedAccessToken), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/].ToString(); + sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } - if (await userManager.IsPhoneNumberConfirmedAsync(user)) + var messageText = Localizer[nameof(AppStrings.ElevatedAccessToken), token].ToString(); + + if (await userManager.IsEmailConfirmedAsync(user)) { - sendMessagesTasks.Add(phoneService.SendSms(messageText, user.PhoneNumber!, cancellationToken)); + sendMessagesTasks.Add(emailService.SendElevatedAccessToken(user, token, cancellationToken)); } //#if (signalR == true) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx index fc3341aaee..ee9cdab483 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx @@ -934,7 +934,8 @@ لطفا کد ۶ رقمی که ارسال کردیم یا کد Authenticator app خود را وارد کنید - توکن {0} + توکن {0} +{1} {0} شما قبلا ایمیل تایید را درخواست کرده اید. دوباره امتحان کنید در {0} @@ -988,19 +989,24 @@ شما قبلا درخواست ایمیل توکن 2FA را دارید. دوباره امتحان کنید در {0} - {0} توکن تغییر شماره تلفن شما است در Boilerplate. + {0} توکن تغییر شماره تلفن شما است در Boilerplate +{1} {0} - {0} توکن تایید شماره تلفن شما است در Boilerplate. + {0} توکن تایید شماره تلفن شما است در Boilerplate +{1} {0} - {0} توکن احراز هویت مرحله دو شما است در Boilerplate. + {0} توکن احراز هویت مرحله دو شما است در Boilerplate +{1} {0} - {0} پسورد یک‌بار مصرف شما است در Boilerplate. + {0} پسورد یک‌بار مصرف شما است در Boilerplate +{1} {0} - {0} توکن تغییر رمز عبور شما است در Boilerplate. + {0} توکن تغییر رمز عبور شما است در Boilerplate +{1} {0} آنلاین diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx index 7e788854da..364d52d559 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx @@ -934,7 +934,8 @@ Voer de verhoogde toegangstoken in die we u zojuist hebben gestuurd of de code van uw authenticator-app om door te gaan. - Token {0} + Token {0} +{1} {0} Je hebt de bevestigingsmail al aangevraagd. Probeer het opnieuw in {0} @@ -988,19 +989,24 @@ Je hebt de e-mail met de 2FA-token al aangevraagd. Probeer het opnieuw in {0}. - {0} is het token voor het wijzigen van uw telefoonnummer in Boilerplate. + {0} is het token voor het wijzigen van uw telefoonnummer in Boilerplate +{1} {0} - {0} is uw bevestigingstelefoonnummer token in Boilerplate. + {0} is uw bevestigingstelefoonnummer token in Boilerplate +{1} {0} - {0} is je tweefactortoken in Boilerplate. + {0} is je tweefactortoken in Boilerplate +{1} {0} - {0} is uw OTP in Boilerplate. + {0} is uw OTP in Boilerplate +{1} {0} - {0} is het token voor het opnieuw instellen van uw wachtwoord in Boilerplate. + {0} is het token voor het opnieuw instellen van uw wachtwoord in Boilerplate +{1} {0} Online diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx index 2073430021..ecc75a62e9 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx @@ -934,7 +934,8 @@ Please enter the elevated access token we just sent you or your authenticator app code to continue. - Token {0} + Token {0} +{1} {0} You have already requested the confirmation email. Try again in {0} @@ -988,19 +989,24 @@ You have already requested the 2FA token email. Try again in {0}. - {0} is your change phone number token in Boilerplate. + {0} is your change phone number token in Boilerplate +{1} {0} - {0} is your confirm phone number token in Boilerplate. + {0} is your confirm phone number token in Boilerplate +{1} {0} - {0} is your two factor token in Boilerplate. + {0} is your two factor token in Boilerplate +{1} {0} - {0} is your OTP in Boilerplate. + {0} is your OTP in Boilerplate +{1} {0} - {0} is your reset password token in Boilerplate. + {0} is your reset password token in Boilerplate +{1} {0} Online From 202caffd27111443844b8d22e8141b82725788b3 Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sat, 4 Jan 2025 02:19:42 +0100 Subject: [PATCH 2/7] Revert "Apply Web OTP pattern to Boilerplate short sent messages (#9612)" This reverts commit b61957d77564290d813b7d5d84084ffa8fed3cca. --- .../IdentityController.PhoneConfirmation.cs | 2 +- .../IdentityController.ResetPassword.cs | 5 ++--- .../Controllers/Identity/IdentityController.cs | 9 ++++----- .../Controllers/Identity/UserController.cs | 14 ++++++-------- .../src/Shared/Resources/AppStrings.fa.resx | 18 ++++++------------ .../src/Shared/Resources/AppStrings.nl.resx | 18 ++++++------------ .../src/Shared/Resources/AppStrings.resx | 18 ++++++------------ 7 files changed, 31 insertions(+), 53 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs index cd750ec47f..1db25ddd3d 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs @@ -78,6 +78,6 @@ private async Task SendConfirmPhoneToken(User user, CancellationToken cancellati var phoneNumber = user.PhoneNumber!; var token = await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"VerifyPhoneNumber:{phoneNumber},{user.PhoneNumberTokenRequestedOn?.ToUniversalTime()}")); - await phoneService.SendSms(Localizer[nameof(AppStrings.ConfirmPhoneTokenSmsText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/], phoneNumber, cancellationToken); + await phoneService.SendSms(Localizer[nameof(AppStrings.ConfirmPhoneTokenSmsText), token], phoneNumber, cancellationToken); } } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs index 72f4e2a090..0b3614af31 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs @@ -45,14 +45,13 @@ public async Task SendResetPasswordToken(SendResetPasswordTokenRequestDto reques sendMessagesTasks.Add(emailService.SendResetPasswordToken(user, token, link, cancellationToken)); } + var message = Localizer[nameof(AppStrings.ResetPasswordTokenShortText), token].ToString(); if (await userManager.IsPhoneNumberConfirmedAsync(user)) { - var smsMessage = Localizer[nameof(AppStrings.ResetPasswordTokenShortText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/].ToString(); - sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); + sendMessagesTasks.Add(phoneService.SendSms(message, user.PhoneNumber!, cancellationToken)); } - var message = Localizer[nameof(AppStrings.ResetPasswordTokenShortText), token].ToString(); //#if (signalR == true) sendMessagesTasks.Add(appHubContext.Clients.User(user.Id.ToString()).SendAsync(SignalREvents.SHOW_MESSAGE, message, cancellationToken)); //#endif diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs index f0e9095def..d11bdb2eb0 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs @@ -308,8 +308,7 @@ public async Task SendOtp(IdentityRequestDto request, string? returnUrl = null, if (await userManager.IsPhoneNumberConfirmedAsync(user)) { - var token = await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"Otp_Sms,{user.OtpRequestedOn?.ToUniversalTime()}")); - var smsMessage = Localizer[nameof(AppStrings.OtpShortText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/].ToString(); + var smsMessage = Localizer[nameof(AppStrings.OtpShortText), await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"Otp_Sms,{user.OtpRequestedOn?.ToUniversalTime()}"))].ToString(); sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } @@ -365,15 +364,15 @@ public async Task SendTwoFactorToken(SignInRequestDto request, CancellationToken sendMessagesTasks.Add(emailService.SendTwoFactorToken(user, token, cancellationToken)); } + var message = Localizer[nameof(AppStrings.TwoFactorTokenShortText), token].ToString(); + if (firstStepAuthenticationMethod != "Sms" && await userManager.IsPhoneNumberConfirmedAsync(user)) { - var smsMessage = Localizer[nameof(AppStrings.TwoFactorTokenShortText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/].ToString(); - sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); + sendMessagesTasks.Add(phoneService.SendSms(message, user.PhoneNumber!, cancellationToken)); } if (firstStepAuthenticationMethod != "Push") { - var message = Localizer[nameof(AppStrings.TwoFactorTokenShortText), token].ToString(); //#if (signalR == true) sendMessagesTasks.Add(appHubContext.Clients.User(user.Id.ToString()).SendAsync(SignalREvents.SHOW_MESSAGE, message, cancellationToken)); //#endif diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs index 15f4c34567..3db42bd079 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs @@ -228,7 +228,7 @@ public async Task SendChangePhoneNumberToken(SendPhoneTokenRequestDto request, C var token = await userManager.GenerateChangePhoneNumberTokenAsync(user!, request.PhoneNumber!); - await phoneService.SendSms(Localizer[nameof(AppStrings.ChangePhoneNumberTokenSmsText), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/], request.PhoneNumber!, cancellationToken); + await phoneService.SendSms(Localizer[nameof(AppStrings.ChangePhoneNumberTokenSmsText), token], request.PhoneNumber!, cancellationToken); } [HttpPost] @@ -388,13 +388,6 @@ public async Task SendElevatedAccessToken(CancellationToken cancellationToken) List sendMessagesTasks = []; - - if (await userManager.IsPhoneNumberConfirmedAsync(user)) - { - var smsMessage = Localizer[nameof(AppStrings.ElevatedAccessToken), $"#{token}", $"@{HttpContext.Request.GetWebAppUrl().Host}" /*Web OTP*/].ToString(); - sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); - } - var messageText = Localizer[nameof(AppStrings.ElevatedAccessToken), token].ToString(); if (await userManager.IsEmailConfirmedAsync(user)) @@ -402,6 +395,11 @@ public async Task SendElevatedAccessToken(CancellationToken cancellationToken) sendMessagesTasks.Add(emailService.SendElevatedAccessToken(user, token, cancellationToken)); } + if (await userManager.IsPhoneNumberConfirmedAsync(user)) + { + sendMessagesTasks.Add(phoneService.SendSms(messageText, user.PhoneNumber!, cancellationToken)); + } + //#if (signalR == true) // Checkout AppHub's comments for more info. var userSessionIdsExceptCurrentUserSessionId = await DbContext.UserSessions diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx index ee9cdab483..fc3341aaee 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx @@ -934,8 +934,7 @@ لطفا کد ۶ رقمی که ارسال کردیم یا کد Authenticator app خود را وارد کنید - توکن {0} -{1} {0} + توکن {0} شما قبلا ایمیل تایید را درخواست کرده اید. دوباره امتحان کنید در {0} @@ -989,24 +988,19 @@ شما قبلا درخواست ایمیل توکن 2FA را دارید. دوباره امتحان کنید در {0} - {0} توکن تغییر شماره تلفن شما است در Boilerplate -{1} {0} + {0} توکن تغییر شماره تلفن شما است در Boilerplate. - {0} توکن تایید شماره تلفن شما است در Boilerplate -{1} {0} + {0} توکن تایید شماره تلفن شما است در Boilerplate. - {0} توکن احراز هویت مرحله دو شما است در Boilerplate -{1} {0} + {0} توکن احراز هویت مرحله دو شما است در Boilerplate. - {0} پسورد یک‌بار مصرف شما است در Boilerplate -{1} {0} + {0} پسورد یک‌بار مصرف شما است در Boilerplate. - {0} توکن تغییر رمز عبور شما است در Boilerplate -{1} {0} + {0} توکن تغییر رمز عبور شما است در Boilerplate. آنلاین diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx index 364d52d559..7e788854da 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx @@ -934,8 +934,7 @@ Voer de verhoogde toegangstoken in die we u zojuist hebben gestuurd of de code van uw authenticator-app om door te gaan. - Token {0} -{1} {0} + Token {0} Je hebt de bevestigingsmail al aangevraagd. Probeer het opnieuw in {0} @@ -989,24 +988,19 @@ Je hebt de e-mail met de 2FA-token al aangevraagd. Probeer het opnieuw in {0}. - {0} is het token voor het wijzigen van uw telefoonnummer in Boilerplate -{1} {0} + {0} is het token voor het wijzigen van uw telefoonnummer in Boilerplate. - {0} is uw bevestigingstelefoonnummer token in Boilerplate -{1} {0} + {0} is uw bevestigingstelefoonnummer token in Boilerplate. - {0} is je tweefactortoken in Boilerplate -{1} {0} + {0} is je tweefactortoken in Boilerplate. - {0} is uw OTP in Boilerplate -{1} {0} + {0} is uw OTP in Boilerplate. - {0} is het token voor het opnieuw instellen van uw wachtwoord in Boilerplate -{1} {0} + {0} is het token voor het opnieuw instellen van uw wachtwoord in Boilerplate. Online diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx index ecc75a62e9..2073430021 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx @@ -934,8 +934,7 @@ Please enter the elevated access token we just sent you or your authenticator app code to continue. - Token {0} -{1} {0} + Token {0} You have already requested the confirmation email. Try again in {0} @@ -989,24 +988,19 @@ You have already requested the 2FA token email. Try again in {0}. - {0} is your change phone number token in Boilerplate -{1} {0} + {0} is your change phone number token in Boilerplate. - {0} is your confirm phone number token in Boilerplate -{1} {0} + {0} is your confirm phone number token in Boilerplate. - {0} is your two factor token in Boilerplate -{1} {0} + {0} is your two factor token in Boilerplate. - {0} is your OTP in Boilerplate -{1} {0} + {0} is your OTP in Boilerplate. - {0} is your reset password token in Boilerplate -{1} {0} + {0} is your reset password token in Boilerplate. Online From 950e1cf3d41c122ed77721429aa0fb7b421f76f5 Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sat, 4 Jan 2025 02:24:53 +0100 Subject: [PATCH 3/7] fix --- .../IdentityController.PhoneConfirmation.cs | 4 +++- .../Identity/IdentityController.ResetPassword.cs | 3 ++- .../Controllers/Identity/IdentityController.cs | 8 ++++++-- .../Controllers/Identity/UserController.cs | 14 +++++++++----- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs index 1db25ddd3d..ca2ffe4065 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs @@ -78,6 +78,8 @@ private async Task SendConfirmPhoneToken(User user, CancellationToken cancellati var phoneNumber = user.PhoneNumber!; var token = await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"VerifyPhoneNumber:{phoneNumber},{user.PhoneNumberTokenRequestedOn?.ToUniversalTime()}")); - await phoneService.SendSms(Localizer[nameof(AppStrings.ConfirmPhoneTokenSmsText), token], phoneNumber, cancellationToken); + var message = Localizer[nameof(AppStrings.ConfirmPhoneTokenSmsText), token]; + var smsMessage = $"{message}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; + await phoneService.SendSms(smsMessage, phoneNumber, cancellationToken); } } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs index 0b3614af31..34d0c9ce89 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.ResetPassword.cs @@ -49,7 +49,8 @@ public async Task SendResetPasswordToken(SendResetPasswordTokenRequestDto reques if (await userManager.IsPhoneNumberConfirmedAsync(user)) { - sendMessagesTasks.Add(phoneService.SendSms(message, user.PhoneNumber!, cancellationToken)); + var smsMessage = $"{message}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; + sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } //#if (signalR == true) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs index d11bdb2eb0..a44797731c 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs @@ -10,6 +10,7 @@ using Boilerplate.Server.Api.Models.Identity; using Boilerplate.Shared.Controllers.Identity; using Boilerplate.Server.Api.Services.Identity; +using Twilio.Jwt.AccessToken; namespace Boilerplate.Server.Api.Controllers.Identity; @@ -308,7 +309,9 @@ public async Task SendOtp(IdentityRequestDto request, string? returnUrl = null, if (await userManager.IsPhoneNumberConfirmedAsync(user)) { - var smsMessage = Localizer[nameof(AppStrings.OtpShortText), await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"Otp_Sms,{user.OtpRequestedOn?.ToUniversalTime()}"))].ToString(); + var token = await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"Otp_Sms,{user.OtpRequestedOn?.ToUniversalTime()}")); + var smsMessage = Localizer[nameof(AppStrings.OtpShortText), token].ToString(); + smsMessage += $"{smsMessage}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } @@ -368,7 +371,8 @@ public async Task SendTwoFactorToken(SignInRequestDto request, CancellationToken if (firstStepAuthenticationMethod != "Sms" && await userManager.IsPhoneNumberConfirmedAsync(user)) { - sendMessagesTasks.Add(phoneService.SendSms(message, user.PhoneNumber!, cancellationToken)); + var smsMessage = $"{message}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; + sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } if (firstStepAuthenticationMethod != "Push") diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs index 3db42bd079..7068d38b7b 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs @@ -228,7 +228,10 @@ public async Task SendChangePhoneNumberToken(SendPhoneTokenRequestDto request, C var token = await userManager.GenerateChangePhoneNumberTokenAsync(user!, request.PhoneNumber!); - await phoneService.SendSms(Localizer[nameof(AppStrings.ChangePhoneNumberTokenSmsText), token], request.PhoneNumber!, cancellationToken); + var message = Localizer[nameof(AppStrings.ChangePhoneNumberTokenSmsText), token]; + var smsMessage = $"{message}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; + + await phoneService.SendSms(smsMessage, request.PhoneNumber!, cancellationToken); } [HttpPost] @@ -388,7 +391,7 @@ public async Task SendElevatedAccessToken(CancellationToken cancellationToken) List sendMessagesTasks = []; - var messageText = Localizer[nameof(AppStrings.ElevatedAccessToken), token].ToString(); + var message = Localizer[nameof(AppStrings.ElevatedAccessToken), token].ToString(); if (await userManager.IsEmailConfirmedAsync(user)) { @@ -397,7 +400,8 @@ public async Task SendElevatedAccessToken(CancellationToken cancellationToken) if (await userManager.IsPhoneNumberConfirmedAsync(user)) { - sendMessagesTasks.Add(phoneService.SendSms(messageText, user.PhoneNumber!, cancellationToken)); + var smsMessage = $"{message}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; + sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } //#if (signalR == true) @@ -406,11 +410,11 @@ public async Task SendElevatedAccessToken(CancellationToken cancellationToken) .Where(us => us.UserId == user.Id && us.Id != currentUserSessionId && us.SignalRConnectionId != null) .Select(us => us.SignalRConnectionId!) .ToArrayAsync(cancellationToken); - sendMessagesTasks.Add(appHubContext.Clients.Clients(userSessionIdsExceptCurrentUserSessionId).SendAsync(SignalREvents.SHOW_MESSAGE, messageText, cancellationToken)); + sendMessagesTasks.Add(appHubContext.Clients.Clients(userSessionIdsExceptCurrentUserSessionId).SendAsync(SignalREvents.SHOW_MESSAGE, message, cancellationToken)); //#endif //#if (notification == true) - sendMessagesTasks.Add(pushNotificationService.RequestPush(message: messageText, userRelatedPush: true, customSubscriptionFilter: us => us.UserSession!.UserId == user.Id && us.UserSessionId != currentUserSessionId, cancellationToken: cancellationToken)); + sendMessagesTasks.Add(pushNotificationService.RequestPush(message: message, userRelatedPush: true, customSubscriptionFilter: us => us.UserSession!.UserId == user.Id && us.UserSessionId != currentUserSessionId, cancellationToken: cancellationToken)); //#endif await Task.WhenAll(sendMessagesTasks); From 7578e905d21b113c5a9b41e8647a1a8927c69441 Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sat, 4 Jan 2025 02:35:47 +0100 Subject: [PATCH 4/7] fix --- .../Controllers/Identity/IdentityController.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs index a44797731c..3a30a9f9d9 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.cs @@ -10,7 +10,6 @@ using Boilerplate.Server.Api.Models.Identity; using Boilerplate.Shared.Controllers.Identity; using Boilerplate.Server.Api.Services.Identity; -using Twilio.Jwt.AccessToken; namespace Boilerplate.Server.Api.Controllers.Identity; @@ -310,8 +309,8 @@ public async Task SendOtp(IdentityRequestDto request, string? returnUrl = null, if (await userManager.IsPhoneNumberConfirmedAsync(user)) { var token = await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"Otp_Sms,{user.OtpRequestedOn?.ToUniversalTime()}")); - var smsMessage = Localizer[nameof(AppStrings.OtpShortText), token].ToString(); - smsMessage += $"{smsMessage}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; + var message = Localizer[nameof(AppStrings.OtpShortText), token].ToString(); + var smsMessage = $"{message}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; sendMessagesTasks.Add(phoneService.SendSms(smsMessage, user.PhoneNumber!, cancellationToken)); } From c658db902dd9ca71aee299e41247623f59386154 Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sat, 4 Jan 2025 08:59:22 +0100 Subject: [PATCH 5/7] fix --- .../wwwroot/.well-known/assetlinks.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/.well-known/assetlinks.json b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/.well-known/assetlinks.json index 3994691b8d..3c198471ba 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/.well-known/assetlinks.json +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Web/wwwroot/.well-known/assetlinks.json @@ -1,7 +1,8 @@ -[ +[ { "relation": [ - "delegate_permission/common.handle_all_urls" + "delegate_permission/common.handle_all_urls", + "delegate_permission/common.get_login_creds" ], "target": { "namespace": "android_app", From 4f8a9e4886502fe3f524c8554218881f4dfdd08a Mon Sep 17 00:00:00 2001 From: ysmoradi Date: Sat, 4 Jan 2025 10:27:19 +0100 Subject: [PATCH 6/7] fix --- .../IdentityController.PhoneConfirmation.cs | 2 +- .../Controllers/Identity/UserController.cs | 4 ++-- .../src/Shared/Resources/AppStrings.fa.resx | 18 +++++++++--------- .../src/Shared/Resources/AppStrings.nl.resx | 18 +++++++++--------- .../src/Shared/Resources/AppStrings.resx | 18 +++++++++--------- .../Identity/SettingsPage.Account.Phone.cs | 2 +- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs index ca2ffe4065..7fe274d25a 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/IdentityController.PhoneConfirmation.cs @@ -78,7 +78,7 @@ private async Task SendConfirmPhoneToken(User user, CancellationToken cancellati var phoneNumber = user.PhoneNumber!; var token = await userManager.GenerateUserTokenAsync(user, TokenOptions.DefaultPhoneProvider, FormattableString.Invariant($"VerifyPhoneNumber:{phoneNumber},{user.PhoneNumberTokenRequestedOn?.ToUniversalTime()}")); - var message = Localizer[nameof(AppStrings.ConfirmPhoneTokenSmsText), token]; + var message = Localizer[nameof(AppStrings.ConfirmPhoneTokenShortText), token]; var smsMessage = $"{message}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; await phoneService.SendSms(smsMessage, phoneNumber, cancellationToken); } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs index 7068d38b7b..80c83b35e6 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Controllers/Identity/UserController.cs @@ -228,7 +228,7 @@ public async Task SendChangePhoneNumberToken(SendPhoneTokenRequestDto request, C var token = await userManager.GenerateChangePhoneNumberTokenAsync(user!, request.PhoneNumber!); - var message = Localizer[nameof(AppStrings.ChangePhoneNumberTokenSmsText), token]; + var message = Localizer[nameof(AppStrings.ChangePhoneNumberTokenShortText), token]; var smsMessage = $"{message}{Environment.NewLine}@{HttpContext.Request.GetWebAppUrl().Host} #{token}" /* Web OTP */; await phoneService.SendSms(smsMessage, request.PhoneNumber!, cancellationToken); @@ -391,7 +391,7 @@ public async Task SendElevatedAccessToken(CancellationToken cancellationToken) List sendMessagesTasks = []; - var message = Localizer[nameof(AppStrings.ElevatedAccessToken), token].ToString(); + var message = Localizer[nameof(AppStrings.ElevatedAccessTokenShortText), token].ToString(); if (await userManager.IsEmailConfirmedAsync(user)) { diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx index fc3341aaee..8540c0b04c 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.fa.resx @@ -933,8 +933,8 @@ لطفا کد ۶ رقمی که ارسال کردیم یا کد Authenticator app خود را وارد کنید - - توکن {0} + + {0} کد شماست در Boilerplate شما قبلا ایمیل تایید را درخواست کرده اید. دوباره امتحان کنید در {0} @@ -987,20 +987,20 @@ شما قبلا درخواست ایمیل توکن 2FA را دارید. دوباره امتحان کنید در {0} - - {0} توکن تغییر شماره تلفن شما است در Boilerplate. + + {0} کد شماست در Boilerplate - - {0} توکن تایید شماره تلفن شما است در Boilerplate. + + {0} کد شماست در Boilerplate - {0} توکن احراز هویت مرحله دو شما است در Boilerplate. + {0} کد شماست در Boilerplate - {0} پسورد یک‌بار مصرف شما است در Boilerplate. + {0} کد شماست در Boilerplate - {0} توکن تغییر رمز عبور شما است در Boilerplate. + {0} کد شماست در Boilerplate آنلاین diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx index 7e788854da..1ccb6a40e1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.nl.resx @@ -933,8 +933,8 @@ Voer de verhoogde toegangstoken in die we u zojuist hebben gestuurd of de code van uw authenticator-app om door te gaan. - - Token {0} + + {0} is je code in Boilerplate. Je hebt de bevestigingsmail al aangevraagd. Probeer het opnieuw in {0} @@ -987,20 +987,20 @@ Je hebt de e-mail met de 2FA-token al aangevraagd. Probeer het opnieuw in {0}. - - {0} is het token voor het wijzigen van uw telefoonnummer in Boilerplate. + + {0} is je code in Boilerplate. - - {0} is uw bevestigingstelefoonnummer token in Boilerplate. + + {0} is je code in Boilerplate. - {0} is je tweefactortoken in Boilerplate. + {0} is je code in Boilerplate. - {0} is uw OTP in Boilerplate. + {0} is je code in Boilerplate. - {0} is het token voor het opnieuw instellen van uw wachtwoord in Boilerplate. + {0} is je code in Boilerplate. Online diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx index 2073430021..ba56c544c3 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Resources/AppStrings.resx @@ -933,8 +933,8 @@ Please enter the elevated access token we just sent you or your authenticator app code to continue. - - Token {0} + + {0} is your code in Boilerplate. You have already requested the confirmation email. Try again in {0} @@ -987,20 +987,20 @@ You have already requested the 2FA token email. Try again in {0}. - - {0} is your change phone number token in Boilerplate. + + {0} is your code in Boilerplate. - - {0} is your confirm phone number token in Boilerplate. + + {0} is your code in Boilerplate. - {0} is your two factor token in Boilerplate. + {0} is your code in Boilerplate. - {0} is your OTP in Boilerplate. + {0} is your code in Boilerplate. - {0} is your reset password token in Boilerplate. + {0} is your code in Boilerplate. Online diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/PageTests/PageModels/Identity/SettingsPage.Account.Phone.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/PageTests/PageModels/Identity/SettingsPage.Account.Phone.cs index 8e32dec93f..799dc19994 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/PageTests/PageModels/Identity/SettingsPage.Account.Phone.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Tests/PageTests/PageModels/Identity/SettingsPage.Account.Phone.cs @@ -59,7 +59,7 @@ public async Task AssertTooManyRequestsForChangePhone() public string GetPhoneToken() { - var pattern = AppStrings.ChangePhoneNumberTokenSmsText.Replace("{0}", @"\b\d{6}\b"); + var pattern = AppStrings.ChangePhoneNumberTokenShortText.Replace("{0}", @"\b\d{6}\b"); return FakePhoneService.GetLastOtpFor(newPhone, pattern); } From 19683c0fce243b561f67c67c96e2ac1ea2b17a65 Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Sat, 4 Jan 2025 14:36:20 +0330 Subject: [PATCH 7/7] add BitOtpInput to change email and phone sections --- .../Authorized/Settings/ChangeEmailSection.razor | 13 ++++++++----- .../Settings/ChangePhoneNumberSection.razor | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/ChangeEmailSection.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/ChangeEmailSection.razor index 9c1b951743..3a277f44d2 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/ChangeEmailSection.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/ChangeEmailSection.razor @@ -10,7 +10,7 @@ @if (Email is not null) { - + } - + diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/ChangePhoneNumberSection.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/ChangePhoneNumberSection.razor index a59613839f..d046de2bbe 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/ChangePhoneNumberSection.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Authorized/Settings/ChangePhoneNumberSection.razor @@ -10,7 +10,7 @@ @if (PhoneNumber is not null) { - + } - +