Skip to content

Commit f6cd471

Browse files
committed
Fix Absolute Uri Platform Differencies
1 parent 60987c5 commit f6cd471

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/CodeBeam.UltimateAuth.Server/Infrastructure/Redirect/AuthRedirectResolver.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private RedirectDecision Resolve(AuthFlowContext flow, HttpContext ctx, string?
2929

3030
if (redirect.AllowReturnUrlOverride && flow.ReturnUrlInfo is { } info)
3131
{
32-
if (info.IsAbsolute)
32+
if (info.IsAbsolute && (info.AbsoluteUri!.Scheme == Uri.UriSchemeHttp || info.AbsoluteUri!.Scheme == Uri.UriSchemeHttps))
3333
{
3434
var origin = info.AbsoluteUri!.GetLeftPart(UriPartial.Authority);
3535
ValidateAllowed(origin, flow.OriginalOptions);
@@ -39,8 +39,7 @@ private RedirectDecision Resolve(AuthFlowContext flow, HttpContext ctx, string?
3939
if (!string.IsNullOrWhiteSpace(info.RelativePath))
4040
{
4141
var baseAddress = _baseAddressResolver.Resolve(ctx, flow.OriginalOptions);
42-
return RedirectDecision.To(
43-
UrlComposer.Combine(baseAddress, info.RelativePath));
42+
return RedirectDecision.To(UrlComposer.Combine(baseAddress, info.RelativePath));
4443
}
4544
}
4645

tests/CodeBeam.UltimateAuth.Tests.Unit/Server/RedirectTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ public void Relative_ReturnUrl_Is_Combined_With_BaseAddress()
125125
var ctx = TestHttpContext.Create(); // https://app.example.com
126126

127127
var decision = resolver.ResolveSuccess(flow, ctx);
128-
129128
decision.TargetUrl.Should().Be("https://app.example.com/dashboard");
130129
}
131130

0 commit comments

Comments
 (0)