1 | <?php |
||
19 | class AuthController extends FOSRestController |
||
20 | { |
||
21 | /** |
||
22 | * Endpoint action to get Access Token for authentication. |
||
23 | * |
||
24 | * @Route("/api/auth/login", methods={"POST"}); |
||
25 | * @SWG\Parameter( |
||
26 | * name="credentials", |
||
27 | * in="formData", |
||
28 | * type="string", |
||
29 | * description="Credentials", |
||
30 | * required=true, |
||
31 | * @SWG\Schema( |
||
32 | * type="object", |
||
33 | * example={"username": "username", "password": "password"} |
||
34 | * ) |
||
35 | * ) |
||
36 | * @SWG\Response( |
||
37 | * response=200, |
||
38 | * description="API Token for user", |
||
39 | * @SWG\Schema( |
||
40 | * type="object", |
||
41 | * example={"api_token": "_api_token_"}, |
||
42 | * @SWG\Property(property="api_token", type="string", description="Api Access Token"), |
||
43 | * ), |
||
44 | * ) |
||
45 | * @SWG\Response( |
||
46 | * response=400, |
||
47 | * description="Bad Request", |
||
48 | * @SWG\Schema( |
||
49 | * type="object", |
||
50 | * example={"message": "message", "errors": "array of errors"}, |
||
51 | * @SWG\Property(property="message", type="integer", description="Error description"), |
||
52 | * @SWG\Property(property="errors", type="array", description="Errors list", @SWG\Items), |
||
53 | * ), |
||
54 | * ) |
||
55 | * @SWG\Tag(name="Authentication") |
||
56 | * |
||
57 | * @throws \LogicException |
||
58 | * @throws \Symfony\Component\HttpKernel\Exception\HttpException |
||
59 | * @param $authUserRequest AuthUserRequest |
||
60 | * @param $authService AuthService |
||
61 | * @return array |
||
62 | */ |
||
63 | 4 | public function login(AuthUserRequest $authUserRequest, AuthService $authService) |
|
71 | } |