@@ -27,6 +27,8 @@ public sealed class WebAuthenticationConcern : IConcern, IRootPathAppender, IHan
27
27
28
28
private IHandler SetupHandler { get ; }
29
29
30
+ private IHandler ResourceHandler { get ; }
31
+
30
32
#endregion
31
33
32
34
#region Initialization
@@ -42,6 +44,8 @@ public WebAuthenticationConcern(IHandler parent, Func<IHandler, IHandler> conten
42
44
43
45
LoginHandler = integration . LoginHandler . Build ( this ) ;
44
46
SetupHandler = integration . SetupHandler . Build ( this ) ;
47
+
48
+ ResourceHandler = integration . ResourceHandler . Build ( this ) ;
45
49
}
46
50
47
51
#endregion
@@ -56,6 +60,13 @@ public WebAuthenticationConcern(IHandler parent, Func<IHandler, IHandler> conten
56
60
{
57
61
var segment = request . Target . Current ;
58
62
63
+ if ( segment ? . Value == Integration . ResourceRoute )
64
+ {
65
+ request . Target . Advance ( ) ;
66
+
67
+ return await ResourceHandler . HandleAsync ( request ) . ConfigureAwait ( false ) ;
68
+ }
69
+
59
70
if ( await Integration . CheckSetupRequired ( request ) . ConfigureAwait ( false ) )
60
71
{
61
72
if ( segment ? . Value != Integration . SetupRoute )
@@ -161,6 +172,11 @@ public void Append(PathBuilder path, IRequest request, IHandler? child = null)
161
172
{
162
173
path . Preprend ( Integration . SetupRoute ) ;
163
174
}
175
+
176
+ if ( child == ResourceHandler )
177
+ {
178
+ path . Preprend ( Integration . ResourceRoute ) ;
179
+ }
164
180
}
165
181
166
182
public IHandler ? Find ( string segment )
@@ -180,6 +196,11 @@ public void Append(PathBuilder path, IRequest request, IHandler? child = null)
180
196
return SetupHandler ;
181
197
}
182
198
199
+ if ( segment == "{web-auth-resources}" )
200
+ {
201
+ return ResourceHandler ;
202
+ }
203
+
183
204
return null ;
184
205
}
185
206
0 commit comments