@@ 54-65 (lines=12) @@ | ||
51 | * |
|
52 | * @return View |
|
53 | */ |
|
54 | public function loginUpdateAction(Request $request): View |
|
55 | { |
|
56 | $user = $this->get('user_login') |
|
57 | ->updateUser( |
|
58 | $request->headers->get('API-Key-Token'), |
|
59 | $request->getContent() |
|
60 | ); |
|
61 | ||
62 | $userResponse = new UserResponse($user); |
|
63 | ||
64 | return View::create($userResponse); |
|
65 | } |
|
66 | ||
67 | /** |
|
68 | * @param Request $request |
|
@@ 74-85 (lines=12) @@ | ||
71 | * |
|
72 | * @return View |
|
73 | */ |
|
74 | public function loginSocialAction(Request $request): View |
|
75 | { |
|
76 | $user = $this->get('user_login') |
|
77 | ->loginSocialNetwork( |
|
78 | $request->headers->get('API-Key-Token'), |
|
79 | $request->getContent() |
|
80 | ); |
|
81 | ||
82 | $userResponse = new UserResponse($user); |
|
83 | ||
84 | return View::create($userResponse); |
|
85 | } |
|
86 | ||
87 | /** |
|
88 | * @param Request $request |
|
@@ 115-123 (lines=9) @@ | ||
112 | * |
|
113 | * @return View |
|
114 | */ |
|
115 | public function meAction(Request $request): View |
|
116 | { |
|
117 | $user = $this->getDoctrine()->getRepository('AppBundle:User') |
|
118 | ->findOneBy(['apiKey' => $request->headers->get('API-Key-Token')]); |
|
119 | ||
120 | $userResponse = new UserResponse($user); |
|
121 | ||
122 | return View::create($userResponse); |
|
123 | } |
|
124 | } |
|
125 |