Skip to content

Commit 71f916e

Browse files
committed
Fix request
1 parent f795419 commit 71f916e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

modules/exampleauth/lib/Auth/Source/External.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,18 @@ public function authenticate(array &$state): void
183183
* This function resumes the authentication process after the user has
184184
* entered his or her credentials.
185185
*
186+
* @param \Symfony\Component\HttpFoundation\Request $request
187+
*
186188
* @throws \SimpleSAML\Error\BadRequest
187189
* @throws \SimpleSAML\Error\Exception
188190
*/
189-
public static function resume(): void
191+
public static function resume(Request $request): void
190192
{
191193
/*
192194
* First we need to restore the $state-array. We should have the identifier for
193195
* it in the 'State' request parameter.
194196
*/
195-
if (!isset($_REQUEST['State'])) {
197+
if (!$request->has('State')) {
196198
throw new Error\BadRequest('Missing "State" parameter.');
197199
}
198200

@@ -201,7 +203,7 @@ public static function resume(): void
201203
* match the string we used in the saveState-call above.
202204
*/
203205
/** @var array $state */
204-
$state = Auth\State::loadState($_REQUEST['State'], 'exampleauth:External');
206+
$state = Auth\State::loadState($request->get('State'), 'exampleauth:External');
205207

206208
/*
207209
* Now we have the $state-array, and can use it to locate the authentication

modules/exampleauth/lib/Controller/ExampleAuth.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,14 @@ public function redirect(Request $request): RunnableResponse
200200
*
201201
* @return \SimpleSAML\HTTP\RunnableResponse
202202
*/
203-
public function resume(/** @scrutinizer ignore-unused */ Request $request): RunnableResponse
203+
public function resume(Request $request): RunnableResponse
204204
{
205205
/**
206206
* This page serves as the point where the user's authentication
207207
* process is resumed after the login page.
208208
*
209209
* It simply passes control back to the class.
210210
*/
211-
212-
return new RunnableResponse([External::class, 'resume'], []);
211+
return new RunnableResponse([External::class, 'resume'], [$request]);
213212
}
214213
}

0 commit comments

Comments
 (0)