Merge pull request 'fix(frontend): auth redirects use strict false-check for auth_links (BIT-22298)' (#10) from fix/BIT-22298-auth-redirect into main
Merge fix/BIT-22298-auth-redirect: auth redirects strict false-check (BIT-22298)
This commit was merged in pull request #10.
This commit is contained in:
commit
b4af1397b7
3 files changed
+13
-2
No files matched your search
@@ -53,4 +53,13 @@ _c="$(code_for "$BASE_URL/wp-json/wp/v2/")"
|
||||
[[ "$_c" == "200" ]] || fail "GET $BASE_URL/wp-json/wp/v2/ expected 200, got $_c (WP andebol :8081)"
|
||||
ok "GET /wp-json/wp/v2/ → $_c"
|
||||
|
||||
# Auth redirects — /entrar and /registar must NOT land on / (BIT-22298)
|
||||
_final_entrar="$(curl -fsS -o /dev/null -w '%{url_effective}' --max-time 25 -L -H "Host: $HOST_HEADER" "$BASE_URL/entrar" 2>/dev/null || true)"
|
||||
[[ "$_final_entrar" == *"wp-login"* ]] || fail "/entrar final URL must contain wp-login; got: $_final_entrar"
|
||||
ok "GET /entrar → $_final_entrar"
|
||||
|
||||
_final_registar="$(curl -fsS -o /dev/null -w '%{url_effective}' --max-time 25 -L -H "Host: $HOST_HEADER" "$BASE_URL/registar" 2>/dev/null || true)"
|
||||
[[ "$_final_registar" == *"wp-login"* ]] || fail "/registar final URL must contain wp-login; got: $_final_registar"
|
||||
ok "GET /registar → $_final_registar"
|
||||
|
||||
echo "All smokes passed for BASE_URL=$BASE_URL (host: $HOST_HEADER)"
|
||||
@@ -2,8 +2,9 @@
|
||||
import { getDomainConfig } from '../lib/domain.js';
|
||||
|
||||
const config = getDomainConfig(Astro.url.hostname);
|
||||
if (!config.auth_links) {
|
||||
if (config.auth_links === false) {
|
||||
return Astro.redirect('/', 302);
|
||||
}
|
||||
Astro.response.headers.set('Cache-Control', 'no-store');
|
||||
return Astro.redirect('/wp-login.php', 302);
|
||||
---
|
||||
@@ -2,8 +2,9 @@
|
||||
import { getDomainConfig } from '../lib/domain.js';
|
||||
|
||||
const config = getDomainConfig(Astro.url.hostname);
|
||||
if (!config.auth_links) {
|
||||
if (config.auth_links === false) {
|
||||
return Astro.redirect('/', 302);
|
||||
}
|
||||
Astro.response.headers.set('Cache-Control', 'no-store');
|
||||
return Astro.redirect('/wp-login.php?action=register', 302);
|
||||
---
|
||||
Reference in new issue
Block a user