FahimAnzamDip / triangle-pos

Triangle POS is an open source Inventory Management with POS System. Developed with Laravel 10, Bootstrap 4 & Livewire 3. It's completely free to use.
643 stars 207 forks source link

Production error on login #24

Closed Michael-254 closed 1 year ago

Michael-254 commented 2 years ago

Upon deployment on production, this occurs on attempt Symfony\Component\HttpFoundation\Response::setContent(): Argument #1 ($content) must be of type ?string,

malitufail commented 1 year ago

Did you figure out the issue?

Michael-254 commented 1 year ago

Nope I had to recreate a new Controller for auth

malitufail commented 1 year ago

I have been trying to figure it out for over a month now, locally it is running fine but after deployment on the shared hosting it is giving this error and routes errors

malitufail commented 1 year ago

"Nope I had to recreate a new Controller for auth"

Did that worked for you?

MrX123123 commented 1 year ago

I have been trying to figure it out for over a month now, locally it is running fine but after deployment on the shared hosting it is giving this error and routes errors

same php and laravel version?

malitufail commented 1 year ago

No php

I have been trying to figure it out for over a month now, locally it is running fine but after deployment on the shared hosting it is giving this error and routes errors

same php and laravel version?

No, laravel version is same but when i set the php to 8.0 it says dependencies for 8.1.2 so i update it to 8.1.2. I have tried every possible way but cant figure this out

Michael-254 commented 1 year ago

Yes this worked for me

malitufail commented 1 year ago

Yes this worked for me

Can you please help me out with this?

alpondith commented 1 year ago

I solved this issue by changing app/Http/Controllers/Auth/LoginController.php

This issue is happening because of authenticated() function has been edited.

Update this function according to https://laravel.com/docs/7.x/authentication#authenticating-users

protected function authenticated(Request $request)
{
        $credentials = $request->only('email', 'password');

        if (Auth::attempt($credentials)) {
            // Authentication passed...
            return redirect()->intended(RouteServiceProvider::HOME);
        }
}
devmpemba commented 1 year ago

Thanks man, this helps me a lot. Gracias!