forked from baron/baron-sso
Merge pull request 'feature/headless-url' (#541) from feature/headless-url into dev
Reviewed-on: baron/baron-sso#541
This commit is contained in:
@@ -19,8 +19,8 @@ fi
|
|||||||
|
|
||||||
if [ "$mode" = "production" ]; then
|
if [ "$mode" = "production" ]; then
|
||||||
echo "Running in production mode with Vite preview..."
|
echo "Running in production mode with Vite preview..."
|
||||||
exec sh -c "npm run build && npm run preview -- --host 127.0.0.1"
|
exec sh -c "npm run build && npm run preview -- --host 0.0.0.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Running in development mode..."
|
echo "Running in development mode..."
|
||||||
exec npm run dev -- --host 127.0.0.1
|
exec npm run dev -- --host 0.0.0.0
|
||||||
|
|||||||
@@ -841,6 +841,15 @@ func (h *AuthHandler) resolveUserfrontURL(c *fiber.Ctx) string {
|
|||||||
if baseURL == "" {
|
if baseURL == "" {
|
||||||
return strings.TrimRight(envURL, "/")
|
return strings.TrimRight(envURL, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
envParsed, envErr := url.Parse(strings.TrimRight(envURL, "/"))
|
||||||
|
baseParsed, baseErr := url.Parse(strings.TrimRight(baseURL, "/"))
|
||||||
|
if envErr == nil && baseErr == nil &&
|
||||||
|
strings.EqualFold(envParsed.Hostname(), baseParsed.Hostname()) &&
|
||||||
|
envParsed.Scheme == "https" && baseParsed.Scheme == "http" {
|
||||||
|
return strings.TrimRight(envURL, "/")
|
||||||
|
}
|
||||||
|
|
||||||
return baseURL
|
return baseURL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ fi
|
|||||||
|
|
||||||
if [ "$mode" = "production" ]; then
|
if [ "$mode" = "production" ]; then
|
||||||
echo "Running in production mode with Vite preview..."
|
echo "Running in production mode with Vite preview..."
|
||||||
exec sh -c "npm run build && npm run preview -- --host 127.0.0.1"
|
exec sh -c "npm run build && npm run preview -- --host 0.0.0.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Running in development mode..."
|
echo "Running in development mode..."
|
||||||
exec npm run dev -- --host 127.0.0.1
|
exec npm run dev -- --host 0.0.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user