diff --git a/RMuseum/Controllers/AppUserController.cs b/RMuseum/Controllers/AppUserController.cs index b959b118..feec3325 100644 --- a/RMuseum/Controllers/AppUserController.cs +++ b/RMuseum/Controllers/AppUserController.cs @@ -45,15 +45,16 @@ namespace RMuseum.Controllers /// protected override string GetSignUpEmailSubject(string secretCode) { - return $"{secretCode} کد ثبت نام شما در گنجینهٔ گنجور"; + return $"{secretCode} کد ثبت نام شما در گنجور"; } /// /// Sign Up Email Html Content /// /// + /// /// html content - protected override string GetSignUpEmailHtmlContent(string secretCode) + protected override string GetSignUpEmailHtmlContent(string secretCode, string signupCallbackUrl) { string content = "" @@ -64,7 +65,7 @@ namespace RMuseum.Controllers + "" + - $"کد ثبت نام شما در گنجینهٔ گنجور: {secretCode}" + $"کد ثبت نام شما در گنجور: {secretCode}" + "" + @@ -78,7 +79,7 @@ namespace RMuseum.Controllers + "" + - "\"گنجینهٔ" + "\"گنجور\"" + "" + @@ -86,13 +87,13 @@ namespace RMuseum.Controllers + "" + - $"

لطفاً جهت تکمیل ثبت نام در گنجینهٔ گنجور اینجا کلیک کنید یا اگر صفحهٔ ثبت نام هنوز باز است کد {secretCode} را در آن وارد کنید.

" + $"

لطفاً جهت تکمیل ثبت نام در گنجور اینجا کلیک کنید یا اگر صفحهٔ ثبت نام هنوز باز است کد {secretCode} را در آن وارد کنید.

" + "" + "" + - "

اگر در گنجینهٔ گنجور ثبت نام نکرده‌اید لطفاً این نامه را نادیده بگیرید. به این نامه پاسخ ندهید، کسی پاسخگوی شما نخواهد بود.

" + "

اگر در گنجور ثبت نام نکرده‌اید لطفاً این نامه را نادیده بگیرید. به این نامه پاسخ ندهید، کسی پاسخگوی شما نخواهد بود.

" + "" + @@ -115,15 +116,16 @@ namespace RMuseum.Controllers /// protected override string GetForgotPasswordEmailSubject(string secretCode) { - return $"{secretCode} کد بازیابی کلمهٔ عبور شما در گنجینهٔ گنجور"; + return $"{secretCode} کد بازیابی کلمهٔ عبور شما در گنجور"; } /// /// Forgot Password Email Html Content /// /// + /// /// html content - protected override string GetForgotPasswordEmailHtmlContent(string secretCode) + protected override string GetForgotPasswordEmailHtmlContent(string secretCode, string forgotPasswordCallbackUrl) { string content = "" @@ -134,7 +136,7 @@ namespace RMuseum.Controllers + "" + - $"کد تغییر گذرواژهٔ شما در گنجینهٔ گنجور: {secretCode}" + $"کد تغییر گذرواژهٔ شما در گنجور: {secretCode}" + "" + @@ -148,7 +150,7 @@ namespace RMuseum.Controllers + "" + - "\"گنجینهٔ" + "\"گنجور\"" + "" + @@ -156,13 +158,13 @@ namespace RMuseum.Controllers + "" + - $"

لطفاً جهت تکمیل فرایند فراموشی گذرواژه در گنجینهٔ گنجور اینجا کلیک کنید یا اگر صفحهٔ فراموشی گذرواژه هنوز باز است کد {secretCode} را در آن وارد کنید.

" + $"

لطفاً جهت تکمیل فرایند فراموشی گذرواژه در گنجور اینجا کلیک کنید یا اگر صفحهٔ فراموشی گذرواژه هنوز باز است کد {secretCode} را در آن وارد کنید.

" + "" + "" + - "

اگر در گنجینهٔ گنجور فراموشی گذرواژه را نزده‌اید یا گذرواژه‌تان را به خاطر آوردید لطفاً این نامه را نادیده بگیرید. به این نامه پاسخ ندهید، کسی پاسخگوی شما نخواهد بود.

" + "

اگر در گنجور فراموشی گذرواژه را نزده‌اید یا گذرواژه‌تان را به خاطر آوردید لطفاً این نامه را نادیده بگیرید. به این نامه پاسخ ندهید، کسی پاسخگوی شما نخواهد بود.

" + "" + diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml index a67a35a7..9f92dae7 100644 --- a/RMuseum/RMuseum.xml +++ b/RMuseum/RMuseum.xml @@ -30,11 +30,12 @@ - + Sign Up Email Html Content + html content @@ -46,11 +47,12 @@ - + Forgot Password Email Html Content + html content diff --git a/RMuseum/appsettings.json b/RMuseum/appsettings.json index 73abb188..48ec38d6 100644 --- a/RMuseum/appsettings.json +++ b/RMuseum/appsettings.json @@ -15,12 +15,6 @@ "Default": "Warning" } }, - "UserSignupClientCallBack": { - "Url": "https://museum.ganjoor.net/signup" - }, - "ForgotPasswordClientCallBack": { - "Url": "https://museum.ganjoor.net/forgot-password" - }, "Security": { "Secret": "k4Fy7pDsc0LgXQ8PCCfZtwmju5Ed8asc", "DefaultTokenExpirationInSeconds": "2502000" diff --git a/RSecurityBackend/Controllers/AppUserControllerBase.cs b/RSecurityBackend/Controllers/AppUserControllerBase.cs index 3d2eb2b8..9dadbe5c 100644 --- a/RSecurityBackend/Controllers/AppUserControllerBase.cs +++ b/RSecurityBackend/Controllers/AppUserControllerBase.cs @@ -793,7 +793,7 @@ namespace RSecurityBackend.Controllers ( signUpViewModel.Email, GetSignUpEmailSubject(res.Result.Secret), - GetSignUpEmailHtmlContent(res.Result.Secret) + GetSignUpEmailHtmlContent(res.Result.Secret, signUpViewModel.CallbackUrl) ); } catch (Exception exp) @@ -820,10 +820,11 @@ namespace RSecurityBackend.Controllers /// Sign Up Email Html Content /// /// + /// /// html content - protected virtual string GetSignUpEmailHtmlContent(string secretCode) + protected virtual string GetSignUpEmailHtmlContent(string secretCode, string signupCallbackUrl) { - return $"{SignupCallbackUrl}?secret={secretCode}"; + return $"{signupCallbackUrl}?secret={secretCode}"; } /// @@ -909,7 +910,7 @@ namespace RSecurityBackend.Controllers ( fpwdViewModel.Email, GetForgotPasswordEmailSubject(res.Result.Secret), - GetForgotPasswordEmailHtmlContent(res.Result.Secret) + GetForgotPasswordEmailHtmlContent(res.Result.Secret, fpwdViewModel.CallbackUrl) ); } catch (Exception exp) @@ -936,10 +937,11 @@ namespace RSecurityBackend.Controllers /// Forgot Password Email Html Content /// /// + /// /// html content - protected virtual string GetForgotPasswordEmailHtmlContent(string secretCode) + protected virtual string GetForgotPasswordEmailHtmlContent(string secretCode, string forgotPasswordCallbackUrl) { - return $"{ForgotPasswordCallbackUrl}?secret={secretCode}"; + return $"{forgotPasswordCallbackUrl}?secret={secretCode}"; } /// @@ -971,34 +973,6 @@ namespace RSecurityBackend.Controllers return Ok(true); } - - - - /// - /// signup callback url - /// - protected string SignupCallbackUrl - { - get - { - return $"{Configuration.GetSection("UserSignupClientCallBack")["Url"]}"; - } - } - - /// - /// forgot password call back url - /// - protected string ForgotPasswordCallbackUrl - { - get - { - return $"{Configuration.GetSection("ForgotPasswordClientCallBack")["Url"]}"; - } - } - - - - /// /// IAppUserService instance /// diff --git a/RSecurityBackend/Models/Auth/ViewModels/UnverifiedSignUpViewModel.cs b/RSecurityBackend/Models/Auth/ViewModels/UnverifiedSignUpViewModel.cs index 1913d9aa..b729aa41 100644 --- a/RSecurityBackend/Models/Auth/ViewModels/UnverifiedSignUpViewModel.cs +++ b/RSecurityBackend/Models/Auth/ViewModels/UnverifiedSignUpViewModel.cs @@ -40,5 +40,10 @@ namespace RSecurityBackend.Models.Auth.ViewModels /// Captcha Value /// public string CaptchaValue { get; set; } + + /// + ///CallbackUrl + /// + public string CallbackUrl { get; set; } } } diff --git a/RSecurityBackend/RSecurityBackend.xml b/RSecurityBackend/RSecurityBackend.xml index 2838e27b..7d467d10 100644 --- a/RSecurityBackend/RSecurityBackend.xml +++ b/RSecurityBackend/RSecurityBackend.xml @@ -216,11 +216,12 @@ - + Sign Up Email Html Content + html content @@ -254,11 +255,12 @@ - + Forgot Password Email Html Content + html content @@ -274,16 +276,6 @@ - - - signup callback url - - - - - forgot password call back url - - IAppUserService instance @@ -1342,6 +1334,11 @@ Captcha Value + + + CallbackUrl + + verified sign up view model