13
13
14
14
use Symfony \Component \DependencyInjection \ContainerAware ;
15
15
use Symfony \Component \HttpFoundation \Request ;
16
- use Symfony \Component \Security \Core \SecurityContext ;
16
+ use Symfony \Component \Security \Core \SecurityContextInterface ;
17
17
18
18
class SecurityController extends ContainerAware
19
19
{
@@ -23,11 +23,11 @@ public function loginAction(Request $request)
23
23
$ session = $ request ->getSession ();
24
24
25
25
// get the error if any (works with forward and redirect -- see below)
26
- if ($ request ->attributes ->has (SecurityContext ::AUTHENTICATION_ERROR )) {
27
- $ error = $ request ->attributes ->get (SecurityContext ::AUTHENTICATION_ERROR );
28
- } elseif (null !== $ session && $ session ->has (SecurityContext ::AUTHENTICATION_ERROR )) {
29
- $ error = $ session ->get (SecurityContext ::AUTHENTICATION_ERROR );
30
- $ session ->remove (SecurityContext ::AUTHENTICATION_ERROR );
26
+ if ($ request ->attributes ->has (SecurityContextInterface ::AUTHENTICATION_ERROR )) {
27
+ $ error = $ request ->attributes ->get (SecurityContextInterface ::AUTHENTICATION_ERROR );
28
+ } elseif (null !== $ session && $ session ->has (SecurityContextInterface ::AUTHENTICATION_ERROR )) {
29
+ $ error = $ session ->get (SecurityContextInterface ::AUTHENTICATION_ERROR );
30
+ $ session ->remove (SecurityContextInterface ::AUTHENTICATION_ERROR );
31
31
} else {
32
32
$ error = '' ;
33
33
}
@@ -37,7 +37,7 @@ public function loginAction(Request $request)
37
37
$ error = $ error ->getMessage ();
38
38
}
39
39
// last username entered by the user
40
- $ lastUsername = (null === $ session ) ? '' : $ session ->get (SecurityContext ::LAST_USERNAME );
40
+ $ lastUsername = (null === $ session ) ? '' : $ session ->get (SecurityContextInterface ::LAST_USERNAME );
41
41
42
42
$ csrfToken = $ this ->container ->has ('form.csrf_provider ' )
43
43
? $ this ->container ->get ('form.csrf_provider ' )->generateCsrfToken ('authenticate ' )
0 commit comments