Support the ongoing development of Laravel.io →
posted 7 years ago
Authentication
Last updated 1 year ago.
0

if you replace the new handler method with the old one it should still work..

0
Solution

Looks like there's a new unauthenticated() method in app/Exceptions/Handler.php which handles unauthenticated users and redirects to login.

As this is part of your app, no reason you couldn't customize it to redirect elsewhere.

protected function unauthenticated($request, AuthenticationException $exception)
    {
        if ($request->expectsJson()) {
            return response()->json(['error' => 'Unauthenticated.'], 401);
        }

        return redirect()->guest('login');
    }

So I simply changed

return redirect()->guest('login');

to

return redirect()->guest('signin');
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Ecaz ecaz Joined 23 Aug 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.