|
@@ -30,6 +30,20 @@ class LoginFormAuthenticator extends AbstractLoginFormAuthenticator
|
|
|
$this->urlGenerator = $urlGenerator;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Called on every request to decide if this authenticator should be
|
|
|
+ * used for the request.
|
|
|
+ *
|
|
|
+ * @param Request $request request
|
|
|
+ *
|
|
|
+ * @return boolean Returning false will cause this authenticator to be skipped.
|
|
|
+ */
|
|
|
+ public function supports(Request $request): bool
|
|
|
+ {
|
|
|
+ return self::LOGIN_ROUTE === $request->attributes->get('_route')
|
|
|
+ && $request->isMethod('POST');
|
|
|
+}
|
|
|
+
|
|
|
public function authenticate(Request $request): PassportInterface
|
|
|
{
|
|
|
$username = $request->request->get('username', '');
|