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

  • Home
  • SEARCH
  • 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 9027461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:45:06+00:00 2026-06-16T06:45:06+00:00

After login failure, the application does not redirect to the login page.Here is my

  • 0

After login failure, the application does not redirect to the login page.Here is my security.yml configuration:

security:
encoders:
    Acme\SecurityBundle\Entity\Users: sha512

role_hierarchy:
    ROLE_ADMIN:       ROLE_USER

providers:
    main:
        entity: { class: Acme\SecurityBundle\Entity\Users}

firewalls:
    dev:
        pattern:  ^/(_(profiler|wdt)|css|images|js)/
        security: false

    login:
        pattern:  ^/login$
        security: false

    secured_area:
        pattern:    ^/admin/
        form_login:
            check_path: /login_check
            login_path: /login
        logout:
            path:   /logout
            target: /home

access_control:
    - { path: ^/admin, roles: ROLE_ADMIN }

Here is my controller:

class LoginController extends Controller {

/**
 * @Route("/login",name="login")
 */
public function loginAction() {
    //displays login form and renders the login.html.twig
}

/**
 * @Route("/login_check", name="login_check")
 */
public function loginCheckAction() {
    // The security layer will intercept this request
}

After login failure I get error as :

  The controller must return a response (null given). Did you forget to add a return statement somewhere in your controller?
  500 Internal Server Error - LogicException 

I tried the login section inside the Demo that ships with symfony. I found the same result.
What modification should I have to make in order redirect to login form after login failure ?

  • 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-06-16T06:45:08+00:00Added an answer on June 16, 2026 at 6:45 am

    You don’t need to create a controller class for the login and logout actions. You just need to specify those routes inside of routing.yml, something like:

    login_path:
      pattern: /login
    login_check_path:
      pattern: /admin/login_check
    logout_path:
      pattern: /admin/logout
    

    These routes are automatically handled by the security component.

    In the firewall configuration, your check_path should be defined as /admin/login_check. The logout path should be /admin/logout.

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

Sidebar

Related Questions

In my application after login I am going into home page. But from home
I found many way for redirect to previous page after login and example :
I have implemented spring-security in my application, my spring-security.xml has following form-login tag. <form-login
I am using Spring Security version 3.1.2. Here is the configuration: <http pattern=/embedded/** auto-config=true
I'm using Spring to handle security in my JSF application. I have a login
I have successfully implemented a custom redirect after a failed login outline in these
My situation is after login my website I wanted to show how many employees
I am Calling an Applet Class After Login. The form is Visible but the
i have created one login and register view in that view after login user
I need to launch an app I've made just after login, before anything else

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.