Skip to content

Commit

Permalink
Return URLs for configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Feb 4, 2019
1 parent c8cb6f0 commit 293ee50
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/FidentConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ public function setAesKey($aesKey)
}

/**
* @param null $returnUrl
*
* @return mixed
*/
public function getRegisterUrl()
public function getRegisterUrl($returnUrl = null)
{
return $this->_registerUrl;
return $this->_registerUrl . ($returnUrl ? '?destination=' . $returnUrl : '');
}

/**
Expand All @@ -68,11 +70,13 @@ public function setRegisterUrl($registerUrl)
}

/**
* @param null $returnUrl
*
* @return mixed
*/
public function getLoginUrl()
public function getLoginUrl($returnUrl = null)
{
return $this->_loginUrl;
return $this->_loginUrl . ($returnUrl ? '?destination=' . $returnUrl : '');
}

/**
Expand All @@ -87,11 +91,13 @@ public function setLoginUrl($loginUrl)
}

/**
* @param null $returnUrl
*
* @return mixed
*/
public function getLogoutUrl()
public function getLogoutUrl($returnUrl = null)
{
return $this->_logoutUrl;
return $this->_logoutUrl . ($returnUrl ? '?destination=' . $returnUrl : '');
}

/**
Expand Down Expand Up @@ -124,8 +130,13 @@ public function setServiceUrl($serviceUrl)
return $this;
}

public function getReauthUrl()
/**
* @param null $returnUrl
*
* @return string
*/
public function getReauthUrl($returnUrl = null)
{
return rtrim($this->_serviceUrl, '/') . '/reauthenticate';
return rtrim($this->_serviceUrl, '/') . '/reauthenticate' . ($returnUrl ? '?destination=' . $returnUrl : '');
}
}

0 comments on commit 293ee50

Please sign in to comment.