Add hasRedirect() method for OAuthServerException

Resolves #694.
This commit is contained in:
Ian Littman
2017-02-04 14:48:40 -05:00
parent ded7c1ed47
commit d8ece093d5
2 changed files with 30 additions and 0 deletions

View File

@@ -273,6 +273,19 @@ class OAuthServerException extends \Exception
return $headers;
}
/**
* Returns whether the exception includes a redirect, since
* getHttpStatusCode() doesn't return a 302 when there's a
* redirect enabled. This helps when you want to override local
* error pages but want to let redirects through.
*
* @return bool
*/
public function hasRedirect()
{
return $this->redirectUri !== null;
}
/**
* Returns the HTTP status code to send when the exceptions is output.
*