Skip to content

Commit d14d820

Browse files
committed
Fix auth-callback-silent routing error in prod-mode UIs
Disable clean URLs in npx serve to prevent 301 redirects from stripping the .html extension on auth-callback-silent.html, which caused Angular to intercept the request and fail with NG04002.
1 parent a858fc0 commit d14d820

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Crucible.AppHost/AppHost.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private static IResourceBuilder<ExecutableResource> AddAngularUI(
117117
else
118118
{
119119
var buildCommand = string.IsNullOrEmpty(buildArgs) ? "npm run build" : $"npm run build {buildArgs}";
120-
var serveProd = $"if [ ! -d {distPath} ] || [ -z \"$(ls -A {distPath} 2>/dev/null)\" ] || [ -n \"$(find src -newer {distPath} -print -quit)\" ]; then npm install && {buildCommand}; fi; npx serve -s {distPath} -l {port}";
120+
var serveProd = $"if [ ! -d {distPath} ] || [ -z \"$(ls -A {distPath} 2>/dev/null)\" ] || [ -n \"$(find src -newer {distPath} -print -quit)\" ]; then npm install && {buildCommand}; fi; echo '{{\"cleanUrls\":false,\"rewrites\":[{{\"source\":\"**\",\"destination\":\"/index.html\"}}]}}' > serve.json && npx serve -c serve.json {distPath} -l {port}";
121121
ui = builder.AddExecutable(name, "bash", appRoot, "-c", serveProd)
122122
.WithHttpEndpoint(port: port, isProxied: false);
123123
}

0 commit comments

Comments
 (0)