From 652a7e390849c07d00f4c49eaa00937963ff758b Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Mon, 26 Oct 2009 15:14:28 +0000
Subject: [PATCH] SimpleSAML_Auth_Simple: Add restart URL when initializing
 login.

This adds a restart URL that should handle bookmarked discovery service page.

Fixes issue 229.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1915 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Auth/Simple.php | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/SimpleSAML/Auth/Simple.php b/lib/SimpleSAML/Auth/Simple.php
index e0d6aedb6..0f056d98b 100644
--- a/lib/SimpleSAML/Auth/Simple.php
+++ b/lib/SimpleSAML/Auth/Simple.php
@@ -84,7 +84,17 @@ class SimpleSAML_Auth_Simple {
 			$returnTo = SimpleSAML_Utilities::createPostRedirectLink($returnTo, $_POST);
 		}
 
-		SimpleSAML_Auth_Default::initLogin($this->authSource, $returnTo);
+		/*
+		 * An URL to restart the authentication, in case the user bookmarks
+		 * something, e.g. the discovery service page.
+		 */
+		$restartURL = $this->getLoginURL($returnTo);
+
+		$hints = array(
+			SimpleSAML_Auth_State::RESTART => $restartURL,
+		);
+
+		SimpleSAML_Auth_Default::initLogin($this->authSource, $returnTo, NULL, $hints);
 	}
 
 
-- 
GitLab