Skip to content

Commit ee3e0f3

Browse files
committed
Add AuthFeature plugin ctor overloads
1 parent dab11c4 commit ee3e0f3

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

src/ServiceStack.Desktop/ServiceStack.Desktop.Source.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
<ProjectReference Include="..\ServiceStack.Common\ServiceStack.Common.Source.csproj" />
1919
<ProjectReference Include="..\ServiceStack\ServiceStack.Source.csproj" />
2020
<ProjectReference Include="..\..\..\ServiceStack.Text\src\ServiceStack.Text\ServiceStack.Text.csproj" />
21-
22-
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
23-
<PackageReference Include="PInvoke.User32" Version="0.6.49" />
24-
<PackageReference Include="PInvoke.Kernel32" Version="0.6.49" />
25-
<PackageReference Include="PInvoke.Gdi32" Version="0.6.49" />
26-
<PackageReference Include="PInvoke.Shell32" Version="0.6.49" />
21+
22+
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
23+
<PackageReference Include="PInvoke.User32" Version="0.7.104" />
24+
<PackageReference Include="PInvoke.Kernel32" Version="0.7.104" />
25+
<PackageReference Include="PInvoke.Gdi32" Version="0.7.104" />
26+
<PackageReference Include="PInvoke.Shell32" Version="0.7.104" />
2727
</ItemGroup>
2828

2929
</Project>

src/ServiceStack/AuthFeature.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ public static void NoExternalRedirects(IRequest req, string redirect)
7777
/// What queryString param to capture redirect param on
7878
/// </summary>
7979
public string HtmlRedirectReturnParam { get; set; } = LocalizedStrings.Redirect;
80+
81+
/// <summary>
82+
/// Redirect path to when Authenticated User requires 2FA
83+
/// </summary>
84+
public string HtmlRedirectLoginWith2Fa { get; set; }
85+
86+
/// <summary>
87+
/// Redirect path to when User is Locked out
88+
/// </summary>
89+
public string HtmlRedirectLockout { get; set; }
8090

8191
/// <summary>
8292
/// Whether to only capture return path or absolute URL (default)
@@ -206,7 +216,9 @@ public AuthFeature AddAuthenticateAliasRoutes()
206216
Permissions = new List<string>(),
207217
UserAuthId = "0",
208218
};
209-
219+
220+
public AuthFeature(IAuthProvider authProvider) : this(() => new AuthUserSession(), new []{ authProvider }) {}
221+
public AuthFeature(IAuthProvider[] authProviders) : this(() => new AuthUserSession(), authProviders) {}
210222
public AuthFeature(Func<IAuthSession> sessionFactory, IAuthProvider[] authProviders, string htmlRedirect = null)
211223
{
212224
this.sessionFactory = sessionFactory;

src/ServiceStack/ErrorMessages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public static class ErrorMessages
3030
public static string PrimaryKeyRequired = "Primary Key is Required";
3131
public static string InvalidAccessToken = "AccessToken is Invalid";
3232
public static string SessionIdEmpty = "Session not set. Is Session being set in RequestFilters?";
33+
public static string Requires2FA = "Session not set. Is Session being set in RequestFilters?";
3334

3435
public static string InvalidRole = "Invalid Role";
3536
public static string InvalidPermission = "Invalid Permission";

0 commit comments

Comments
 (0)