Skip to content

Commit 293ee50

Browse files
committed
Return URLs for configuration
1 parent c8cb6f0 commit 293ee50

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

src/FidentConfiguration.php

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ public function setAesKey($aesKey)
4949
}
5050

5151
/**
52+
* @param null $returnUrl
53+
*
5254
* @return mixed
5355
*/
54-
public function getRegisterUrl()
56+
public function getRegisterUrl($returnUrl = null)
5557
{
56-
return $this->_registerUrl;
58+
return $this->_registerUrl . ($returnUrl ? '?destination=' . $returnUrl : '');
5759
}
5860

5961
/**
@@ -68,11 +70,13 @@ public function setRegisterUrl($registerUrl)
6870
}
6971

7072
/**
73+
* @param null $returnUrl
74+
*
7175
* @return mixed
7276
*/
73-
public function getLoginUrl()
77+
public function getLoginUrl($returnUrl = null)
7478
{
75-
return $this->_loginUrl;
79+
return $this->_loginUrl . ($returnUrl ? '?destination=' . $returnUrl : '');
7680
}
7781

7882
/**
@@ -87,11 +91,13 @@ public function setLoginUrl($loginUrl)
8791
}
8892

8993
/**
94+
* @param null $returnUrl
95+
*
9096
* @return mixed
9197
*/
92-
public function getLogoutUrl()
98+
public function getLogoutUrl($returnUrl = null)
9399
{
94-
return $this->_logoutUrl;
100+
return $this->_logoutUrl . ($returnUrl ? '?destination=' . $returnUrl : '');
95101
}
96102

97103
/**
@@ -124,8 +130,13 @@ public function setServiceUrl($serviceUrl)
124130
return $this;
125131
}
126132

127-
public function getReauthUrl()
133+
/**
134+
* @param null $returnUrl
135+
*
136+
* @return string
137+
*/
138+
public function getReauthUrl($returnUrl = null)
128139
{
129-
return rtrim($this->_serviceUrl, '/') . '/reauthenticate';
140+
return rtrim($this->_serviceUrl, '/') . '/reauthenticate' . ($returnUrl ? '?destination=' . $returnUrl : '');
130141
}
131142
}

0 commit comments

Comments
 (0)