15
15
use Symfony \Component \HttpFoundation \RedirectResponse ;
16
16
use Symfony \Component \HttpFoundation \Request ;
17
17
use Symfony \Component \Security \Core \Authentication \Token \TokenInterface ;
18
- use Symfony \Component \Security \Core \Encoder \UserPasswordEncoderInterface ;
19
18
use Symfony \Component \Security \Core \Exception \AuthenticationException ;
20
- use Symfony \Component \Security \Core \Exception \BadCredentialsException ;
21
19
use Symfony \Component \Security \Core \Security ;
22
- use Symfony \Component \Security \Core \User \UserInterface ;
23
- use Symfony \Component \Security \Core \User \UserProviderInterface ;
24
20
25
21
/**
26
22
* A base class to make form login authentication easier!
30
26
abstract class AbstractFormLoginAuthenticator extends AbstractGuardAuthenticator
31
27
{
32
28
/**
33
- * Return the URL to the login page
29
+ * Return the URL to the login page.
34
30
*
35
31
* @return string
36
32
*/
@@ -40,17 +36,18 @@ abstract protected function getLoginUrl();
40
36
* The user will be redirected to the secure page they originally tried
41
37
* to access. But if no such page exists (i.e. the user went to the
42
38
* login page directly), this returns the URL the user should be redirected
43
- * to after logging in successfully (e.g. your homepage)
39
+ * to after logging in successfully (e.g. your homepage).
44
40
*
45
41
* @return string
46
42
*/
47
43
abstract protected function getDefaultSuccessRedirectUrl ();
48
44
49
45
/**
50
- * Override to change what happens after a bad username/password is submitted
46
+ * Override to change what happens after a bad username/password is submitted.
51
47
*
52
- * @param Request $request
48
+ * @param Request $request
53
49
* @param AuthenticationException $exception
50
+ *
54
51
* @return RedirectResponse
55
52
*/
56
53
public function onAuthenticationFailure (Request $ request , AuthenticationException $ exception )
@@ -62,11 +59,12 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
62
59
}
63
60
64
61
/**
65
- * Override to change what happens after successful authentication
62
+ * Override to change what happens after successful authentication.
66
63
*
67
- * @param Request $request
64
+ * @param Request $request
68
65
* @param TokenInterface $token
69
- * @param string $providerKey
66
+ * @param string $providerKey
67
+ *
70
68
* @return RedirectResponse
71
69
*/
72
70
public function onAuthenticationSuccess (Request $ request , TokenInterface $ token , $ providerKey )
@@ -91,8 +89,9 @@ public function supportsRememberMe()
91
89
* Override to control what happens when the user hits a secure page
92
90
* but isn't logged in yet.
93
91
*
94
- * @param Request $request
92
+ * @param Request $request
95
93
* @param AuthenticationException|null $authException
94
+ *
96
95
* @return RedirectResponse
97
96
*/
98
97
public function start (Request $ request , AuthenticationException $ authException = null )
0 commit comments