mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[feature/oauth] OAuth service exception
PHPBB3-11673
This commit is contained in:
parent
d847df7175
commit
7f6b2a9849
5 changed files with 32 additions and 6 deletions
|
@ -67,7 +67,7 @@ class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_
|
|||
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly))
|
||||
{
|
||||
// TODO: make exception class and use language constant
|
||||
throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
}
|
||||
|
||||
// This was a callback request from bitly, get the token
|
||||
|
@ -87,7 +87,7 @@ class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_
|
|||
{
|
||||
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly))
|
||||
{
|
||||
throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
}
|
||||
|
||||
// Send a request with it
|
||||
|
|
24
phpBB/phpbb/auth/provider/oauth/service/exception.php
Normal file
24
phpBB/phpbb/auth/provider/oauth/service/exception.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @package controller
|
||||
* @copyright (c) 2012 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* OAuth service exception class
|
||||
* @package phpBB3
|
||||
*/
|
||||
class phpbb_auth_provider_oauth_service_exception extends RuntimeException
|
||||
{
|
||||
}
|
|
@ -66,7 +66,7 @@ class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oau
|
|||
{
|
||||
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
|
||||
{
|
||||
throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
}
|
||||
|
||||
// This was a callback request, get the token
|
||||
|
@ -86,7 +86,7 @@ class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oau
|
|||
{
|
||||
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
|
||||
{
|
||||
throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
}
|
||||
|
||||
// Send a request with it
|
||||
|
|
|
@ -77,7 +77,7 @@ class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth
|
|||
{
|
||||
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google))
|
||||
{
|
||||
throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
}
|
||||
|
||||
// This was a callback request, get the token
|
||||
|
@ -97,7 +97,7 @@ class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth
|
|||
{
|
||||
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google))
|
||||
{
|
||||
throw new Exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
|
||||
}
|
||||
|
||||
// Send a request with it
|
||||
|
|
|
@ -52,6 +52,7 @@ interface phpbb_auth_provider_oauth_service_interface
|
|||
/**
|
||||
* Returns the results of the authentication in json format
|
||||
*
|
||||
* @throws phpbb_auth_provider_oauth_service_exception
|
||||
* @return string The unique identifier returned by the service provider
|
||||
* that is used to authenticate the user with phpBB.
|
||||
*/
|
||||
|
@ -61,6 +62,7 @@ interface phpbb_auth_provider_oauth_service_interface
|
|||
* Returns the results of the authentication in json format
|
||||
* Use this function when the user already has an access token
|
||||
*
|
||||
* @throws phpbb_auth_provider_oauth_service_exception
|
||||
* @return string The unique identifier returned by the service provider
|
||||
* that is used to authenticate the user with phpBB.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue