aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/ApiBundle/Controller/UserRestController.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php
index becbbb9e..7471f5f6 100644
--- a/src/Wallabag/ApiBundle/Controller/UserRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php
@@ -28,13 +28,14 @@ class UserRestController extends WallabagRestController
28 } 28 }
29 29
30 /** 30 /**
31 * Register an user. 31 * Register an user and create a client.
32 * 32 *
33 * @ApiDoc( 33 * @ApiDoc(
34 * requirements={ 34 * requirements={
35 * {"name"="username", "dataType"="string", "required"=true, "description"="The user's username"}, 35 * {"name"="username", "dataType"="string", "required"=true, "description"="The user's username"},
36 * {"name"="password", "dataType"="string", "required"=true, "description"="The user's password"}, 36 * {"name"="password", "dataType"="string", "required"=true, "description"="The user's password"},
37 * {"name"="email", "dataType"="string", "required"=true, "description"="The user's email"} 37 * {"name"="email", "dataType"="string", "required"=true, "description"="The user's email"},
38 * {"name"="client_name", "dataType"="string", "required"=true, "description"="The client name (to be used by your app)"}
38 * } 39 * }
39 * ) 40 * )
40 * 41 *
@@ -100,7 +101,7 @@ class UserRestController extends WallabagRestController
100 101
101 // create a default client 102 // create a default client
102 $client = new Client($user); 103 $client = new Client($user);
103 $client->setName('Default client'); 104 $client->setName($request->request->get('client_name', 'Default client'));
104 105
105 $this->getDoctrine()->getManager()->persist($client); 106 $this->getDoctrine()->getManager()->persist($client);
106 107