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