Rename device code endpoint to /devicecode

This commit is contained in:
ErickSkrauch 2024-12-24 01:20:58 +01:00
parent 085b4f5ca6
commit 1c11c66b9c
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
2 changed files with 5 additions and 5 deletions

View File

@ -63,7 +63,7 @@ final class AuthorizationController extends Controller {
return $this->oauthProcess->complete($this->getServerRequest());
}
public function actionDevice(): array {
public function actionDevicecode(): array {
return $this->oauthProcess->deviceCode($this->getServerRequest());
}

View File

@ -10,7 +10,7 @@ use Codeception\Example;
final class DeviceCodeCest {
public function initiateFlow(FunctionalTester $I): void {
$I->sendPOST('/api/oauth2/v1/device', [
$I->sendPOST('/api/oauth2/v1/devicecode', [
'client_id' => 'ely',
'scope' => 'account_info minecraft_server_session',
]);
@ -56,7 +56,7 @@ final class DeviceCodeCest {
#[Examples(false)]
public function finishFlowWithApprovedCode(FunctionalTester $I, Example $case): void {
// Initialize flow
$I->sendPOST('/api/oauth2/v1/device', [
$I->sendPOST('/api/oauth2/v1/devicecode', [
'client_id' => 'ely',
'scope' => 'account_info minecraft_server_session',
]);
@ -95,7 +95,7 @@ final class DeviceCodeCest {
}
public function getAnErrorForUnknownClient(FunctionalTester $I): void {
$I->sendPOST('/api/oauth2/v1/device', [
$I->sendPOST('/api/oauth2/v1/devicecode', [
'client_id' => 'invalid-client',
'scope' => 'account_info minecraft_server_session',
]);
@ -106,7 +106,7 @@ final class DeviceCodeCest {
}
public function getAnErrorForInvalidScopes(FunctionalTester $I): void {
$I->sendPOST('/api/oauth2/v1/device', [
$I->sendPOST('/api/oauth2/v1/devicecode', [
'client_id' => 'ely',
'scope' => 'unknown-scope',
]);