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) { - + } - + 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", 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..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,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.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/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..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 @@ -308,7 +308,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 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)); } @@ -368,7 +370,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..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,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.ChangePhoneNumberTokenShortText), 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.ElevatedAccessTokenShortText), 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); 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); }