Commit 73c9f92238240de45d3035611a751e3d62b8c73e

Authored by Alex Savenko
1 parent d75736d6

user registration

app/library/App/Controllers/ProjectController.php
@@ -19,7 +19,7 @@ class ProjectController extends CrudResourceController { @@ -19,7 +19,7 @@ class ProjectController extends CrudResourceController {
19 'test' => '123' 19 'test' => '123'
20 ]; 20 ];
21 21
22 - return $this->createArrayResponse($response, 'data'); 22 + return $this->createResponse($response);
23 23
24 } 24 }
25 25
app/library/App/Model/User.php
@@ -25,8 +25,4 @@ class User extends \App\Mvc\DateTrackingModel @@ -25,8 +25,4 @@ class User extends \App\Mvc\DateTrackingModel
25 'role' => 'role' 25 'role' => 'role'
26 ]; 26 ];
27 } 27 }
28 -  
29 - public function initialize() {  
30 -  
31 - }  
32 } 28 }
app/library/App/Resources/UserResource.php
@@ -31,6 +31,7 @@ class UserResource extends ApiResource { @@ -31,6 +31,7 @@ class UserResource extends ApiResource {
31 ->allow(AclRoles::USER) 31 ->allow(AclRoles::USER)
32 ->description('Returns the currently logged in user') 32 ->description('Returns the currently logged in user')
33 ) 33 )
  34 +
34 ->endpoint(ApiEndpoint::post('/authenticate', 'authenticate') 35 ->endpoint(ApiEndpoint::post('/authenticate', 'authenticate')
35 ->allow(AclRoles::UNAUTHORIZED) 36 ->allow(AclRoles::UNAUTHORIZED)
36 ->deny(AclRoles::AUTHORIZED) 37 ->deny(AclRoles::AUTHORIZED)
@@ -40,9 +41,8 @@ class UserResource extends ApiResource { @@ -40,9 +41,8 @@ class UserResource extends ApiResource {
40 'expires' => 1451139067 41 'expires' => 1451139067
41 ]) 42 ])
42 ) 43 )
  44 +
43 ->endpoint(ApiEndpoint::post('/registration', 'registration')) 45 ->endpoint(ApiEndpoint::post('/registration', 'registration'))
44 - ->allow(AclRoles::UNAUTHORIZED)  
45 - ->deny(AclRoles::AUTHORIZED)  
46 ; 46 ;
47 } 47 }
48 } 48 }
49 \ No newline at end of file 49 \ No newline at end of file