8000 Merge branch '3.4' into 4.1 · symfony/symfony-docs@1019797 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1019797

Browse files
committed
Merge branch '3.4' into 4.1
* 3.4: Wrapped some long lines Fix and improve JSON login docs [Serializer] Updated the list of loaded encoders
2 parents 7014015 + 18002e4 commit 1019797

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

security/json_login_setup.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ path:
8080
*/
8181
public function login(Request $request)
8282
{
83+
$user = $this->getUser();
84+
85+
return $this->json(array(
86+
'username' => $user->getUsername(),
87+
'roles' => $user->getRoles(),
88+
));
8389
}
8490
}
8591
@@ -117,11 +123,11 @@ path:
117123
118124
return $routes;
119125
120-
Don't let this empty controller confuse you. When you submit a ``POST`` request
121-
to the ``/login`` URL with the following JSON document as the body, the security
122-
system intercepts the requests. It takes care of authenticating the user with
123-
the submitted username and password or triggers an error in case the authentication
124-
process fails:
126+
When you submit a ``POST`` request to the ``/login`` URL with the following JSON
127+
document as the body, the security system intercepts the requests.
128+
It takes care of authenticating the user with the submitted username and password
129+
or triggers an error in case the authentication process fails.
130+
If the authentication is successful, the controller defined earlier will be executed.
125131

126132
.. code-block:: json
127133

serializer.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Encoders supporting the following formats are enabled:
5252

5353
* JSON: :class:`Symfony\\Component\\Serializer\\Encoder\\JsonEncoder`
5454
* XML: :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder`
55+
* CSV: :class:`Symfony\\Component\\Serializer\\Encoder\\CsvEncoder`
56+
* YAML: :class:`Symfony\\Component\\Serializer\\Encoder\\YamlEncoder`
5557

5658
As well as the following normalizers:
5759

0 commit comments

Comments
 (0)
0