@@ -438,7 +438,7 @@ Next, create the controller that will display the login form::
438
438
439
439
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
440
440
use Symfony\Component\HttpFoundation\Request;
441
- use Symfony\Component\Security\Core\SecurityContext ;
441
+ use Symfony\Component\Security\Core\SecurityContextInterface ;
442
442
443
443
class SecurityController extends Controller
444
444
{
@@ -447,20 +447,20 @@ Next, create the controller that will display the login form::
447
447
$session = $request->getSession();
448
448
449
449
// get the login error if there is one
450
- if ($request->attributes->has(SecurityContext ::AUTHENTICATION_ERROR)) {
450
+ if ($request->attributes->has(SecurityContextInterface ::AUTHENTICATION_ERROR)) {
451
451
$error = $request->attributes->get(
452
- SecurityContext ::AUTHENTICATION_ERROR
452
+ SecurityContextInterface ::AUTHENTICATION_ERROR
453
453
);
454
454
} else {
455
- $error = $session->get(SecurityContext ::AUTHENTICATION_ERROR);
456
- $session->remove(SecurityContext ::AUTHENTICATION_ERROR);
455
+ $error = $session->get(SecurityContextInterface ::AUTHENTICATION_ERROR);
456
+ $session->remove(SecurityContextInterface ::AUTHENTICATION_ERROR);
457
457
}
458
458
459
459
return $this->render(
460
460
'AcmeSecurityBundle:Security:login.html.twig',
461
461
array(
462
462
// last username entered by the user
463
- 'last_username' => $session->get(SecurityContext ::LAST_USERNAME),
463
+ 'last_username' => $session->get(SecurityContextInterface ::LAST_USERNAME),
464
464
'error' => $error,
465
465
)
466
466
);
0 commit comments