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