mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-22 23:26:31 +01:00
49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using Serilog;
|
|
using TINK.Repository.Request;
|
|
|
|
namespace TINK.ViewModel.CopriWebView
|
|
{
|
|
/// <summary> Manages the copri web view for password forgotton use case. </summary>
|
|
public class PasswordForgottonViewModel
|
|
{
|
|
/// <summary> Holds the merchant id.</summary>
|
|
private string MerchantId { get; }
|
|
|
|
/// <summary> Holds the name of the host.</summary>
|
|
private string HostName { get; }
|
|
|
|
/// <summary>
|
|
/// Holds the current ui two letter ISO language name.
|
|
/// </summary>
|
|
private string UiIsoLanguageName { get; }
|
|
|
|
/// <param name="uiIsoLangugageName">Two letter ISO language name.</param>
|
|
public PasswordForgottonViewModel(
|
|
string merchantId,
|
|
string uiIsoLangugageName,
|
|
string hostName)
|
|
{
|
|
MerchantId = merchantId;
|
|
UiIsoLanguageName = uiIsoLangugageName;
|
|
HostName = hostName;
|
|
}
|
|
|
|
/// <summary> Get Uri of web view providing password forgotton functionality. </summary>
|
|
public string Uri
|
|
{
|
|
get
|
|
{
|
|
var sessionIdQueryElement = QueryBuilderHelper.GetSessionIdQueryElement("?", MerchantId);
|
|
|
|
string GetUriText()
|
|
=> !string.IsNullOrEmpty(sessionIdQueryElement)
|
|
? $"https://{HostName}/app/Account{sessionIdQueryElement}{QueryBuilderHelper.GetLanguageQueryElement("&", UiIsoLanguageName)}"
|
|
: $"https://{HostName}/app/Account";
|
|
|
|
Log.ForContext<PasswordForgottonViewModel>().Debug($"Request to open url {GetUriText()} to get privacy info.");
|
|
|
|
return GetUriText();
|
|
}
|
|
}
|
|
}
|
|
}
|