From 96bb5ad68c7bbd876cc49b41cbcd27045b7c8e46 Mon Sep 17 00:00:00 2001
From: Jaime Perez Crespo <jaime.perez@uninett.no>
Date: Sun, 30 Aug 2015 20:22:51 +0200
Subject: [PATCH] Reimplement the old SimpleSAML_Auth_Default::loginCompleted()
 as a wrapper of the refactored method in SimpleSAML_Auth_Source, now that the
 latter is public again.

---
 lib/SimpleSAML/Auth/Default.php | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/lib/SimpleSAML/Auth/Default.php b/lib/SimpleSAML/Auth/Default.php
index 213ab01c3..2d7a3d33b 100644
--- a/lib/SimpleSAML/Auth/Default.php
+++ b/lib/SimpleSAML/Auth/Default.php
@@ -36,29 +36,10 @@ class SimpleSAML_Auth_Default {
 
 
 	/**
-	 * @deprecated This method will be removed in SSP 2.0.
+	 * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Auth_Source::loginCompleted() instead.
 	 */
 	public static function loginCompleted($state) {
-		assert('is_array($state)');
-		assert('array_key_exists("SimpleSAML_Auth_Default.Return", $state)');
-		assert('array_key_exists("SimpleSAML_Auth_Default.id", $state)');
-		assert('array_key_exists("Attributes", $state)');
-		assert('!array_key_exists("LogoutState", $state) || is_array($state["LogoutState"])');
-
-		$return = $state['SimpleSAML_Auth_Default.Return'];
-
-		/* Save session state. */
-		$session = SimpleSAML_Session::getSessionFromRequest();
-		$authId = $state['SimpleSAML_Auth_Default.id'];
-		$session->doLogin($authId, SimpleSAML_Auth_State::getPersistentAuthData($state));
-
-		if (is_string($return)) {
-			/* Redirect... */
-			\SimpleSAML\Utils\HTTP::redirectTrustedURL($return);
-		} else {
-			call_user_func($return, $state);
-			assert('FALSE');
-		}
+		SimpleSAML_Auth_Source::loginCompleted($state);
 	}
 
 
-- 
GitLab