public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
    {
        $this->dispatcher->dispatch(self::WEBSItE_STATELESS_GUARD_AUTH_FAILED, new AuthFailedEvent($request, $exception));
        
        return $this->removeAuthCookieFromResponse(new RedirectResponse($this->createLoginPath($request)));
    }
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
    {
        $this->dispatcher->dispatch(self::WEBSItE_STATELESS_GUARD_AUTH_FAILED, new AuthFailedEvent($request, $exception));
        
        return $this->removeAuthCookieFromResponse(new RedirectResponse($this->createLoginPath($request)));
    }
public function onAuthenticationFailure ( Request $ request , AuthenticationException $ exception ) { $ this -> dispatcher -> dispatch ( self :: WEBSItE_STATELESS_GUARD_AUTH_FAILED , new AuthFailedEvent ( $ request , $ exception ) ) ; return $ this -> removeAuthCookieFromResponse ( new RedirectResponse ( $ this -> createLoginPath ( $ request ) ) ) ; }
4b) If the response fails it will redirect the request to the login page with next_url for redirect purposes

@param Request $request
@param AuthenticationException $exception
@return RedirectResponse|Response
4b ) If the response fails it will redirect the request to the login page with next_url for redirect purposes