Skip to content

Commit 05b95b3

Browse files
committed
update external source as required
1 parent 45ec949 commit 05b95b3

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lib/Auth/Source/External.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use SimpleSAML\Module\drupalauth\ConfigHelper;
1414
use SimpleSAML\Module\drupalauth\DrupalHelper;
1515
use SimpleSAML\Utils\HTTP;
16+
use Symfony\Component\HttpFoundation\Request;
17+
use Symfony\Component\HttpFoundation\Response;
1618

1719
/**
1820
* Drupal authentication source for SimpleSAMLphp using Drupal's login page.
@@ -169,7 +171,7 @@ private function getUser()
169171
*
170172
* @param array &$state Information about the current authentication.
171173
*/
172-
public function authenticate(array &$state): void
174+
public function authenticate(Request $request, array &$state): ?Response
173175
{
174176
assert(is_array($state));
175177

@@ -182,7 +184,7 @@ public function authenticate(array &$state): void
182184
* to the authentication process.
183185
*/
184186
$state['Attributes'] = $attributes;
185-
return;
187+
return null;
186188
}
187189

188190
/*
@@ -236,14 +238,9 @@ public function authenticate(array &$state): void
236238
* the real name of the parameter for the login page.
237239
*/
238240
$http_utils = new HTTP();
239-
$http_utils->redirectTrustedURL($authPage, [
241+
return $http_utils->redirectTrustedURL($authPage, [
240242
'ReturnTo' => $returnTo,
241243
]);
242-
243-
/*
244-
* The redirect function never returns, so we never get this far.
245-
*/
246-
assert(false);
247244
}
248245

249246
/**
@@ -328,7 +325,7 @@ public static function resume()
328325
*
329326
* @param array &$state The logout state array.
330327
*/
331-
public function logout(array &$state): void
328+
public function logout(array &$state): ?Response
332329
{
333330
assert(is_array($state));
334331

@@ -349,6 +346,6 @@ public function logout(array &$state): void
349346
}
350347

351348
$http_utils = new HTTP();
352-
$http_utils->redirectTrustedURL($logout_url, $parameters);
349+
return $http_utils->redirectTrustedURL($logout_url, $parameters);
353350
}
354351
}

0 commit comments

Comments
 (0)