Help! Laravel Modify the Users table, resulting in the inability to log in, adding and removing functions failed

Source: Internet
Author: User

I have just started to learn laravel, when doing login encountered a very difficult problem.
It was all right, but when I changed the user table structure (adding a column), I could not log in, even after deleting the added column still can't log in, click Login and then jump back to the login page, the HTTP status code is 200.

Even more bizarre is that I added DD (' AAA ') to the Postlogin method after the program did not terminate and print ' AAA ', but continue to return to the login page, as if the program suddenly out of my control. Then I canceled all the controller's auth middleware found that all the query function is normal, the new modification delete function is not good, and did not report any error, the problem in the end where? Online and so on!

public function postLogin(Request $request){    dd('aaa');    $this->validate($request, [        'username' => 'required', 'password' => 'required',    ]);    $credentials = $request->only('username', 'password');    if ($this->auth->attempt($credentials, $request->has('remember')))    {        return redirect()->intended($this->redirectPath());    }    return redirect($this->loginPath())                ->withInput($request->only('username', 'remember'))                ->withErrors([                    'username' => $this->getFailedLoginMessage(),                ]);}

Reply content:

I have just started to learn laravel, when doing login encountered a very difficult problem.
It was all right, but when I changed the user table structure (adding a column), I could not log in, even after deleting the added column still can't log in, click Login and then jump back to the login page, the HTTP status code is 200.

Even more bizarre is that I added DD (' AAA ') to the Postlogin method after the program did not terminate and print ' AAA ', but continue to return to the login page, as if the program suddenly out of my control. Then I canceled all the controller's auth middleware found that all the query function is normal, the new modification delete function is not good, and did not report any error, the problem in the end where? Online and so on!

public function postLogin(Request $request){    dd('aaa');    $this->validate($request, [        'username' => 'required', 'password' => 'required',    ]);    $credentials = $request->only('username', 'password');    if ($this->auth->attempt($credentials, $request->has('remember')))    {        return redirect()->intended($this->redirectPath());    }    return redirect($this->loginPath())                ->withInput($request->only('username', 'remember'))                ->withErrors([                    'username' => $this->getFailedLoginMessage(),                ]);}
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.