Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6872875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:59:06+00:00 2026-05-27T03:59:06+00:00

I need to disable redirection after login check, because I need to get only

  • 0

I need to disable redirection after login check, because I need to get only that the login was success or not. After submission /login_check url give me the right data, but keep redirecting to /login (on failure).
/login is blank after that.
I am trying to set up login form using extjs 4 so I need to validate trough an ajax post request.
login_check should authenticate, create user session and return whether it was success or failure, but no forwarding anywhere.

my login.html.twig looks like:

{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
    { success:true }
{% else %}
    { success: false }
{% endif %}

and in security.yml:

firewalls:
    main:
        form_login:
            provider: fos_userbundle
            failure_path:  null
            failure_forward: false
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:59:07+00:00Added an answer on May 27, 2026 at 3:59 am

    Create an authentication handler:

    namespace YourVendor\UserBundle\Handler;
    
    // "use" statements here
    
    class AuthenticationHandler
    implements AuthenticationSuccessHandlerInterface,
               AuthenticationFailureHandlerInterface
    {
        public function onAuthenticationSuccess(Request $request, TokenInterface $token)
        {
            if ($request->isXmlHttpRequest()) {
                $result = array('success' => true);
                return new Response(json_encode($result));
            } else {
                // Handle non XmlHttp request here
            }
        }
    
        public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
        {
            if ($request->isXmlHttpRequest()) {
                $result = array('success' => false);
                return new Response(json_encode($result));
            } else {
                // Handle non XmlHttp request here
            }
        }
    }
    

    Register the handler as a service:

    services:
        authentication_handler:
            class: YourVendor\UserBundle\Handler\AuthenticationHandler
    

    Register the service in the firewall:

    firewalls:
        main:
            form_login:
                success_handler: authentication_handler
                failure_handler: authentication_handler
    

    This is a rough example to give you the general idea — you’ll need to figure out the details by yourself. If you’re stuck and need further clarifications, put your questions in the comments and I’ll try to elaborate the example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need to disable automatic url encoding in flash as2 because i have URL
I need to disable check-in operation for several projects in my solution. I need
For example I need to disable two buttons in runtime. After I disabled first
I don't really need to disable them because I either disable the TabControl or
I need to disable the buttons in UIActionSheet. after some operations i need to
I need to disable all the check boxes inside a table cell when clicking
I need to disable that indexing when I enter on my root directory on
I need to disable the TO address on compose mail UI. Because i used
I need to disable/not show a Change Install Location button in installer. How do
I need to place custom keypad . For that, I need to disable my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.