1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

Merge pull request #2748 from appwrite/fix-oauth-cleanup

OAUTh: Code  cleanup
This commit is contained in:
Eldad A. Fux 2022-02-04 18:15:22 +02:00 committed by GitHub
commit 1334546ebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -480,7 +480,7 @@ App::get('/v1/mock/tests/general/oauth2/token')
->label('sdk.mock', true)
->param('client_id', '', new Text(100), 'OAuth2 Client ID.')
->param('client_secret', '', new Text(100), 'OAuth2 scope list.')
->param('grant_type', '', new WhiteList(['refresh_token', 'authorization_code']), 'OAuth2 Grant Type.', true)
->param('grant_type', 'authorization_code', new WhiteList(['refresh_token', 'authorization_code']), 'OAuth2 Grant Type.', true)
->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.', true)
->param('code', '', new Text(100), 'OAuth2 state.', true)
->param('refresh_token', '', new Text(100), 'OAuth2 refresh token.', true)
@ -488,10 +488,6 @@ App::get('/v1/mock/tests/general/oauth2/token')
->action(function ($client_id, $client_secret, $grantType, $redirectURI, $code, $refreshToken, $response) {
/** @var Appwrite\Utopia\Response $response */
if(empty($grantType)) {
$grantType = 'authorization_code';
}
if ($client_id != '1') {
throw new Exception('Invalid client ID');
}