PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Unsolved

Login Error - Ninja Media Script

iambuxer

Feb 9th, 2018 08:49 PM

Hello.

I have this error when I try to login: https://screenshots.firefox.com/heX6QZZnzJ5LX7kQ/www.huevadas.net

Anyone knows how to solve it?

Thanks!

mark

Feb 10th, 2018 11:15 AM

You can remove the VerifyCsrf from the middleware at application/app/Http/Kernel.php.

iambuxer

Feb 10th, 2018 12:31 PM

@mark I removed it and don't get the error anymore but also doesn't log me in. Do you know why this happened?

devdojo

Feb 11th, 2018 03:37 AM

@iambuxer, can you try the solutions at the bottom of this forum post: https://laravel.io/forum/01-30-2015-laravel5-tokenmismatchexception-in-verifycsrftoken

Looks like these users were having a similar issue.

Keep me posted. Thanks.

mark

Feb 11th, 2018 07:50 AM

It could be a session issue. Since if the CRSF token was not to be stored in the session, it would complain, along once the user is being logged in, the session would not remember the user and have them redirected back to the login without any error showing. A good way to test the session is to make the 2 following routes:

Route::get('logged-in', function () {
    return Auth::check() ? 'Logged in!' : 'Not logged in!';
});

Route::get('force-login', function () {
    Auth::login(App\User::firstOrFail);
    return Auth::check() ? 'Logged in!' : 'Not logged in!';
});
mark

Feb 11th, 2018 07:50 AM

It should remember your user between the 2 routes, if not, then you have a session issue.

iambuxer

Feb 11th, 2018 03:24 PM

@devdojo I tried them but none worked

@mark where should I add that code? I added it in "application/routes/web.php" but didn't do anything

mark

Feb 12th, 2018 05:51 AM

Yes, in application/routes/web.php, then you should be able to access your-site.com/logged-in and your-site.com/force-login.

iambuxer

Feb 12th, 2018 11:40 AM

@mark I just tried it and when I go to /logged-in it says "not logged in!" and when I go to /force-login it shows the Whoops, looks like something went wrong page without errors... Should I delete the script and install it again?

mark

Feb 12th, 2018 11:55 AM

I made a error, it should be Auth::login(App\User::firstOrFail());, not Auth::login(App\User::firstOrFail);.

iambuxer

Feb 12th, 2018 12:05 PM

I just changed it but the same happens when I go to /force-login

devdojo

Feb 12th, 2018 02:40 PM

@iambuxer,

If you want to send me over your FTP info here: https://codecanyon.net/user/devdojo I can help you troubleshoot this further :)

Thanks.

iambuxer

Feb 12th, 2018 02:57 PM

@devdojo thanks a lot. I just sent you a message on Codecanyon.

devdojo

Feb 12th, 2018 03:17 PM

Got it! Thanks.

Ok, I'm actually kind of confused. I was able to signup for an account on your site and then I was able to login just fine. I just sent you back a message. If you could send me over the login info you are trying to use that will help me troubleshoot the issue.

What device and browser are you trying to login from? That might help me replicate the issue on my end.

iambuxer

Feb 12th, 2018 03:29 PM

@devdojo I'm trying to login from Firefox 58.0.2 and from Chrome 64.

Load More Answers