fix: use browser redirect page for mx login

This commit is contained in:
Marek Miklewicz
2026-06-30 19:34:01 +02:00
parent 7d3d458160
commit d5894a1935
5 changed files with 48 additions and 3 deletions
+14
View File
@@ -0,0 +1,14 @@
<?php
declare(strict_types=1);
require_once PLUGIN_ROOT . '/exec/lib/Http.php';
test('http redirect page performs top level browser navigation', function (): void {
$html = Http::redirectPageHtml('https://mx1.domena.pl:2222/api/login/url?key=SECRET&x=1');
assert_contains('window.top.location.replace', $html);
assert_contains('window.location.replace', $html);
assert_contains('<meta http-equiv="refresh"', $html);
assert_contains('https://mx1.domena.pl:2222/api/login/url?key=SECRET&amp;x=1', $html);
assert_contains('https://mx1.domena.pl:2222/api/login/url?key=SECRET\\u0026x=1', $html);
});