mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Create a client when creating a user using the api
While creating a new user using the API, we also create a new client for the current user. So the app which just create the user can use its newly created client to configure the app. That new client is only return after creating the user. When calling the endpoint /api/user to get user information, the new client information won’t be return.
This commit is contained in:
parent
7bb3aa3177
commit
0c00e52516
5 changed files with 82 additions and 13 deletions
|
@ -61,10 +61,16 @@ class UserRestControllerTest extends WallabagApiTestCase
|
|||
$this->assertArrayHasKey('username', $content);
|
||||
$this->assertArrayHasKey('created_at', $content);
|
||||
$this->assertArrayHasKey('updated_at', $content);
|
||||
$this->assertArrayHasKey('default_client', $content);
|
||||
|
||||
$this->assertEquals('wallabag@google.com', $content['email']);
|
||||
$this->assertEquals('google', $content['username']);
|
||||
|
||||
$this->assertArrayHasKey('client_secret', $content['default_client']);
|
||||
$this->assertArrayHasKey('client_id', $content['default_client']);
|
||||
|
||||
$this->assertEquals('Default client', $content['default_client']['name']);
|
||||
|
||||
$this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type'));
|
||||
|
||||
$this->client->getContainer()->get('craue_config')->set('api_user_registration', 0);
|
||||
|
@ -90,10 +96,16 @@ class UserRestControllerTest extends WallabagApiTestCase
|
|||
$this->assertArrayHasKey('username', $content);
|
||||
$this->assertArrayHasKey('created_at', $content);
|
||||
$this->assertArrayHasKey('updated_at', $content);
|
||||
$this->assertArrayHasKey('default_client', $content);
|
||||
|
||||
$this->assertEquals('wallabag@google.com', $content['email']);
|
||||
$this->assertEquals('google', $content['username']);
|
||||
|
||||
$this->assertArrayHasKey('client_secret', $content['default_client']);
|
||||
$this->assertArrayHasKey('client_id', $content['default_client']);
|
||||
|
||||
$this->assertEquals('Default client', $content['default_client']['name']);
|
||||
|
||||
$this->assertEquals('application/json', $client->getResponse()->headers->get('Content-Type'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('api_user_registration', 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue