Skip to content

Commit

Permalink
Infrastructure Preparation 50
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Dec 13, 2023
1 parent 50979f3 commit 67fd8e0
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@
}
},
"Authentication": {
"TwoFactorRemember": {
"CookieDomain": ".vegalya.com",
"CookieName": "Factorial",
"CookieExpires": 30
},
"TwoFactorUserId": {
"CookieDomain": ".vegalya.com",
"CookieName": "Factorial",
"CookieExpires": 30
},
"CookieDomain": ".vegalya.com",
"CookieName": "Factorial",
"CookieExpires": 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Taiizor.Starterkit" Version="1.1.4.3" />
<PackageReference Include="Taiizor.Starterkit" Version="1.1.4.4" />
</ItemGroup>

</Project>
24 changes: 24 additions & 0 deletions src/Taiizor.Starterkit/Extension/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,30 @@ public bool IsLangActiveLang(string lang)
return false;
}

// Set the authentication two factor remember cookie domain
public void SetTwoFactorRememberCookieDomain(string flag)
{
ThemeSettings.Config.Authentication.TwoFactorRemember.CookieDomain = flag;
}

// Get the authentication two factor remember cookie domain
public string GetTwoFactorRememberCookieDomain()
{
return ThemeSettings.Config.Authentication.TwoFactorRemember.CookieDomain;
}

// Set the authentication two factor user id cookie domain
public void SetTwoFactorUserIdCookieDomain(string flag)
{
ThemeSettings.Config.Authentication.TwoFactorUserId.CookieDomain = flag;
}

// Get the authentication two factor user id cookie domain
public string GetTwoFactorUserIdCookieDomain()
{
return ThemeSettings.Config.Authentication.TwoFactorUserId.CookieDomain;
}

// Set the authentication cookie domain
public void SetAuthenticationCookieDomain(string flag)
{
Expand Down
4 changes: 4 additions & 0 deletions src/Taiizor.Starterkit/Extension/ThemeAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ public class ThemeAuthentication
public string CookieName { get; set; }

public string CookieDomain { get; set; }

public ThemeTwoFactorUserId TwoFactorUserId { get; set; }

public ThemeTwoFactorRemember TwoFactorRemember { get; set; }
}
}
2 changes: 2 additions & 0 deletions src/Taiizor.Starterkit/Extension/ThemeSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public static void Init(IConfiguration Configuration, string Key)
Config.Antiforgery.CookieDomain = "localhost";
Config.Authenticator.CookieDomain = "localhost";
Config.Authentication.CookieDomain = "localhost";
Config.Authentication.TwoFactorUserId.CookieDomain = "localhost";
Config.Authentication.TwoFactorRemember.CookieDomain = "localhost";
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/Taiizor.Starterkit/Extension/ThemeTwoFactorRemember.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Taiizor.Starterkit.Extension
{
public class ThemeTwoFactorRemember
{
public int CookieExpires { get; set; }

public string CookieName { get; set; }

public string CookieDomain { get; set; }
}
}
11 changes: 11 additions & 0 deletions src/Taiizor.Starterkit/Extension/ThemeTwoFactorUserId.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Taiizor.Starterkit.Extension
{
public class ThemeTwoFactorUserId
{
public int CookieExpires { get; set; }

public string CookieName { get; set; }

public string CookieDomain { get; set; }
}
}
8 changes: 8 additions & 0 deletions src/Taiizor.Starterkit/Interface/ITheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ public interface ITheme

bool IsLangActiveLang(string lang);

void SetTwoFactorRememberCookieDomain(string flag);

string GetTwoFactorRememberCookieDomain();

void SetTwoFactorUserIdCookieDomain(string flag);

string GetTwoFactorUserIdCookieDomain();

void SetAuthenticationCookieDomain(string flag);

string GetAuthenticationCookieDomain();
Expand Down
10 changes: 10 additions & 0 deletions src/Taiizor.Starterkit/Resources/FactorySettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@
}
},
"Authentication": {
"TwoFactorRemember": {
"CookieDomain": ".vegalya.com",
"CookieName": "Factorial",
"CookieExpires": 30
},
"TwoFactorUserId": {
"CookieDomain": ".vegalya.com",
"CookieName": "Factorial",
"CookieExpires": 30
},
"CookieDomain": ".vegalya.com",
"CookieName": "Factorial",
"CookieExpires": 30
Expand Down
2 changes: 1 addition & 1 deletion src/Taiizor.Starterkit/Taiizor.Starterkit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<PropertyGroup>
<ApplicationIcon>Resources\Taiizor.Starterkit.ico</ApplicationIcon>
<Version>1.1.4.4</Version>
<Version>1.1.4.5</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>Taiizor.Starterkit</Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Taiizor.Starterkit" Version="1.1.4.3" />
<PackageReference Include="Taiizor.Starterkit" Version="1.1.4.4" />
</ItemGroup>

</Project>

0 comments on commit 67fd8e0

Please sign in to comment.