X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOAuth%2FRevoke.php;h=0604e90bf7de2bbcae6b3f0d3f277d3ded09e599;hb=99284222c1d7fb4adca9077e3057faf3b36f7180;hp=c64193243730502f94e4495e579eea98c49ca576;hpb=78a85df86b2a86c61264b7fcf457b8e17c411d99;p=friendica.git diff --git a/src/Module/OAuth/Revoke.php b/src/Module/OAuth/Revoke.php index c641932437..0604e90bf7 100644 --- a/src/Module/OAuth/Revoke.php +++ b/src/Module/OAuth/Revoke.php @@ -1,6 +1,6 @@ getRequest([ + 'client_id' => '', // Client ID, obtained during app registration + 'client_secret' => '', // Client secret, obtained during app registration + 'token' => '', // The previously obtained token, to be invalidated + ], $request); + + $condition = ['client_id' => $request['client_id'], 'client_secret' => $request['client_secret'], 'access_token' => $request['token']]; + $token = DBA::selectFirst('application-view', ['id'], $condition); + if (empty($token['id'])) { + Logger::notice('Token not found', $condition); + DI::mstdnError()->Unauthorized(); + } + + DBA::delete('application-token', ['application-id' => $token['id']]); + System::jsonExit([]); } }