Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
technobel.sf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mathieu
technobel.sf
Commits
1fad7504
Commit
1fad7504
authored
Jul 03, 2018
by
Mat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encryptage du password + résolution erreur du login-check
parent
106fd4c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
app/config/routing.yml
app/config/routing.yml
+1
-1
app/config/security.yml
app/config/security.yml
+1
-1
src/SocketBundle/Controller/ChatController.php
src/SocketBundle/Controller/ChatController.php
+5
-1
src/SocketBundle/Resources/views/Login/login.html.twig
src/SocketBundle/Resources/views/Login/login.html.twig
+1
-1
No files found.
app/config/routing.yml
View file @
1fad7504
...
...
@@ -6,7 +6,7 @@ socket:
logout
:
path
:
/logout
login
_
check
:
login
-
check
:
path
:
/login-check
###
...
...
app/config/security.yml
View file @
1fad7504
...
...
@@ -34,7 +34,7 @@ security:
form_login
:
login_path
:
login
check_path
:
login-check
# une route ou un chemin
default_target_path
:
/chat
default_target_path
:
chat_message
# ce sera souvent la page d'accueil
always_use_default_target_path
:
true
logout
:
...
...
src/SocketBundle/Controller/ChatController.php
View file @
1fad7504
...
...
@@ -7,6 +7,7 @@ use SocketBundle\Form\UserType;
use
Symfony\Bundle\FrameworkBundle\Controller\Controller
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\Routing\Annotation\Route
;
use
Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface
;
use
Symfony\Component\Security\Http\Authentication\AuthenticationUtils
;
class
ChatController
extends
Controller
...
...
@@ -45,7 +46,7 @@ class ChatController extends Controller
* @Route(name="register", path="/register")
* @return \Symfony\Component\HttpFoundation\Response
*/
public
function
registerAction
(
Request
$request
)
public
function
registerAction
(
Request
$request
,
UserPasswordEncoderInterface
$encoder
)
{
$user
=
new
User
();
...
...
@@ -56,6 +57,9 @@ class ChatController extends Controller
{
$user
->
setRole
([
"ROLE_USER"
]);
// on affecte un rôle
$pwd
=
$encoder
->
encodePassword
(
$user
,
$user
->
getPassword
());
$user
->
setPassword
(
$pwd
);
$em
=
$this
->
getDoctrine
()
->
getManager
();
$em
->
persist
(
$user
);
$em
->
flush
();
...
...
src/SocketBundle/Resources/views/Login/login.html.twig
View file @
1fad7504
...
...
@@ -6,7 +6,7 @@
</head>
<body>
<form
action=
"
{{
path
(
'login
_
check'
)
}}
"
method=
"post"
>
<form
action=
"
{{
path
(
'login
-
check'
)
}}
"
method=
"post"
>
{%
if
error
!=
null
%}
{{
error.message
}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment