|
19 | 19 | use Symfony\Component\HttpFoundation\Request; |
20 | 20 | use Symfony\Component\HttpFoundation\RedirectResponse; |
21 | 21 | use Symfony\Component\HttpFoundation\Response; |
22 | | -use Symfony\Component\HttpFoundation\StreamedResponse; |
23 | 22 |
|
24 | 23 | /** |
25 | 24 | * Controller class for the webauthn module. |
@@ -92,7 +91,7 @@ public function setLogger(Logger $logger): void |
92 | 91 |
|
93 | 92 | /** |
94 | 93 | * @param \Symfony\Component\HttpFoundation\Request $request |
95 | | - * @return \Symfony\Component\HttpFoundation\RedirectResponse|\SimpleSAML\HTTP\RunnableResponse|\Symfony\Component\HttpFoundation\StreamedResponse |
| 94 | + * @return \Symfony\Component\HttpFoundation\RedirectResponse|\SimpleSAML\HTTP\RunnableResponse |
96 | 95 | * A Symfony Response-object. |
97 | 96 | */ |
98 | 97 | public function main(Request $request): Response |
@@ -196,14 +195,16 @@ public function main(Request $request): Response |
196 | 195 |
|
197 | 196 | $id = $this->authState::saveState($state, 'webauthn:request'); |
198 | 197 | if ($debugEnabled === true) { |
199 | | - $response = new StreamedResponse(); |
200 | | - $response->setCallback(function ($regObject, $id) { |
201 | | - echo $regObject->getDebugBuffer(); |
202 | | - echo $regObject->getValidateBuffer(); |
203 | | - echo "<form id='regform' method='POST' action='" . |
204 | | - Module::getModuleURL('webauthn/webauthn.php?StateId=' . urlencode($id)) . "'>"; |
205 | | - echo "<button type='submit'>Return to previous page.</button>"; |
206 | | - }); |
| 198 | + $response = new RunnableResponse( |
| 199 | + function ($regObject, $id) { |
| 200 | + echo $regObject->getDebugBuffer(); |
| 201 | + echo $regObject->getValidateBuffer(); |
| 202 | + echo "<form id='regform' method='POST' action='" . |
| 203 | + Module::getModuleURL('webauthn/webauthn.php?StateId=' . urlencode($id)) . "'>"; |
| 204 | + echo "<button type='submit'>Return to previous page.</button>"; |
| 205 | + }, |
| 206 | + [$regObject, $id] |
| 207 | + ); |
207 | 208 | } elseif (array_key_exists('Registration', $state)) { |
208 | 209 | $response = new RedirectResponse(Module::getModuleURL('webauthn/webauthn.php?StateId=' . urlencode($id))); |
209 | 210 | } else { |
|
0 commit comments