Skip to content

Commit

Permalink
Fix startup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag committed Dec 3, 2024
1 parent e9b9c88 commit f8e421a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/startup-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
working-directory: ${{ env.frontend-directory }}
run: |
response=$(curl -d "[email protected]&password=1234" -H "Origin: https://localhost:8443" https://localhost:8443/login\?/login -k)
server_reponse='{"type":"redirect","status":302,"location":"/?refresh=1"}'
server_reponse='{"type":"redirect","status":302,"location":"/"}'
echo "[SERVER_RESPONSE] $response"
echo "[EXPECTED_RESPONSE] $server_reponse"
if [[ "$response" == "$server_reponse" ]]; then
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
working-directory: ${{ env.frontend-directory }}
run: |
response=$(curl -d "[email protected]&password=1234" -H "Origin: https://localhost:8443" https://localhost:8443/login\?/login -k)
server_reponse='{"type":"redirect","status":302,"location":"/?refresh=1"}'
server_reponse='{"type":"redirect","status":302,"location":"/"}'
echo "[SERVER_RESPONSE] $response"
echo "[EXPECTED_RESPONSE] $server_reponse"
if [[ "$response" == "$server_reponse" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/routes/(authentication)/login/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ interface AuthenticationFlow {
}

function makeRedirectURL(currentLang: string, preferedLang: string, url: URL): string {
const next = url.searchParams.get('next') || '/';
const secureNext = getSecureRedirect(next);
if (currentLang == preferedLang) {
const next = url.searchParams.get('next');
const secureNext = getSecureRedirect(next) || '/';
if (currentLang === preferedLang) {
return secureNext;
}
return secureNext ? `${secureNext}?refresh=1` : `/?refresh=1`;
Expand Down

0 comments on commit f8e421a

Please sign in to comment.