public function onAuthenticationSuccess(Request $request, TokenInterface $token)
    {
        if ($request->isXmlHttpRequest()) {
            $result = array('success' => true);
            $response = new JsonResponse($result);

            return $response;
        }
    }
public function onAuthenticationSuccess(Request $request, TokenInterface $token)
    {
        if ($request->isXmlHttpRequest()) {
            $result = array('success' => true);
            $response = new JsonResponse($result);

            return $response;
        }
    }
public function onAuthenticationSuccess ( Request $ request , TokenInterface $ token ) { if ( $ request -> isXmlHttpRequest ( ) ) { $ result = array ( 'success' => true ) ; $ response = new JsonResponse ( $ result ) ; return $ response ; } }
This is called when an interactive authentication attempt succeeds.

@param Request        $request
@param TokenInterface $token
@return JsonResponse the response to return
This is called when an interactive authentication attempt succeeds .