File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,9 @@ public function changePassword(
70
70
if ($ form ->isSubmitted () && $ form ->isValid ()) {
71
71
$ entityManager ->flush ();
72
72
73
- // The second argument is to disable CSRF protection before logout.
74
- // A CSRF token is already verified by the form.
75
- $ security ->logout (false );
76
-
77
- return $ this ->redirectToRoute ('security_login ' );
73
+ // The logout method has a protection against CSRF attacks, it's disabled here
74
+ // because the form already has a CSRF token validated.
75
+ return $ security ->logout (false );
78
76
}
79
77
80
78
return $ this ->render ('user/change_password.html.twig ' , [
Original file line number Diff line number Diff line change @@ -104,12 +104,9 @@ public function testChangePassword(): void
104
104
105
105
$ this ->assertResponseRedirects ();
106
106
$ this ->assertResponseRedirects (
107
- '/en/login ' ,
107
+ '/ ' ,
108
108
Response::HTTP_FOUND ,
109
109
'Changing password logout the user. '
110
110
);
111
-
112
- $ client ->followRedirect ();
113
- $ this ->assertResponseStatusCodeSame (Response::HTTP_OK );
114
111
}
115
112
}
You can’t perform that action at this time.
0 commit comments