Fix SAML login "something went wrong" when language list = 1 (#5750)

# Description of Changes

<!--
Please provide a summary of the changes, including:

- What was changed
- Why the change was made
- Any challenges encountered

Closes #(issue_number)
-->

---

## Checklist

### General

- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### Translations (if applicable)

- [ ] I ran
[`scripts/counter_translation.py`](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/docs/counter_translation.md)

### UI Changes (if applicable)

- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing)
for more details.
This commit is contained in:
Anthony Stirling
2026-02-18 08:49:08 +00:00
committed by GitHub
parent 757a666f5e
commit 8d5b3eb36b
13 changed files with 89 additions and 51 deletions

View File

@@ -74,7 +74,7 @@ services:
DOCKER_ENABLE_SECURITY: "true"
SECURITY_ENABLELOGIN: "true"
SECURITY_LOGINMETHOD: "${SECURITY_LOGINMETHOD:-all}"
SYSTEM_DEFAULTLOCALE: en-US
SYSTEM_DEFAULTLOCALE: "${SYSTEM_DEFAULTLOCALE:-en-US}"
SYSTEM_BACKENDURL: "http://localhost:8080"
# Enterprise License (required for SAML)

View File

@@ -13,24 +13,48 @@ echo -e "${BLUE}╚════════════════════
echo ""
AUTO_LOGIN=false
DEFAULT_LANGUAGE="en-US"
COMPOSE_UP_ARGS=(-d --build)
for arg in "$@"; do
case "$arg" in
while [[ $# -gt 0 ]]; do
case "$1" in
--auto)
AUTO_LOGIN=true
shift
;;
--nobuild)
COMPOSE_UP_ARGS=(-d)
shift
;;
--language)
if [[ -z "${2:-}" ]]; then
echo -e "${RED}Missing value for --language${NC}"
exit 1
fi
DEFAULT_LANGUAGE="$2"
shift 2
;;
--language=*)
DEFAULT_LANGUAGE="${1#*=}"
shift
;;
-l)
if [[ -z "${2:-}" ]]; then
echo -e "${RED}Missing value for -l${NC}"
exit 1
fi
DEFAULT_LANGUAGE="$2"
shift 2
;;
-h|--help)
echo "Usage: $0 [--auto] [--nobuild]"
echo "Usage: $0 [--auto] [--nobuild] [--language <locale>]"
echo ""
echo " --auto Enable SSO auto-login and force SAML-only login method"
echo " --nobuild Skip building images (use existing images)"
echo " --language Set system default locale (e.g. de-DE, sv-SE)"
exit 0
;;
*)
echo -e "${RED}Unknown option: $arg${NC}"
echo -e "${RED}Unknown option: $1${NC}"
exit 1
;;
esac
@@ -65,6 +89,10 @@ if [ "$AUTO_LOGIN" = true ]; then
echo ""
fi
export SYSTEM_DEFAULTLOCALE="$DEFAULT_LANGUAGE"
echo -e "${GREEN}✓ Default locale set to: ${SYSTEM_DEFAULTLOCALE}${NC}"
echo ""
echo -e "${YELLOW}▶ Starting Keycloak (SAML) containers...${NC}"
docker-compose -f docker-compose-keycloak-saml.yml up "${COMPOSE_UP_ARGS[@]}" keycloak-saml-db keycloak-saml