Add an exception for a missing scope

This commit is contained in:
Andrew Millington 2017-10-18 22:08:11 +01:00
parent e7ee483d11
commit c70451abd5

View File

@ -195,6 +195,21 @@ class OAuthServerException extends \Exception
);
}
/**
* Missing scope error
*
* @param null|string $redirectUri A HTTP URI to redirect the user back to
*
* @return static
*/
public static function missingScope($redirectUri = null)
{
$errorMessage = 'No scope was specified for this request';
$hint = 'Set a default scope on the server if no scopes are passed in the request';
return new static($errorMessage, 11, 'missing_scope', 400, $hint, $redirectUri);
}
/**
* @return string
*/