Authenticated/Not Authenticated Redirect

Asked

Viewed 33 times

-1

When we protect a route by login and try to access this route without being logged in the log-in sends us to the login screen. So if you authenticate it sends to that route you tried to access without being logged in.

I have a problem because I would not like the Portable to keep this attempt to access and redirect. I would like to know how to treat this?

  • Estou com um problema pois não gostaria que o Laravel guardasse essa tentativa de acesso e redirecionamento. Gostaria de saber como tratar isso? what you want to do?

  • I’d like to control this so that it’s only redirected to the route I’ve set as a standard example. Apos Login goes to /home and good only that

1 answer

1

The Laravel treats this in various ways. The recurrent way is the use of trait: Illuminate\Foundation\Auth\AuthenticatesUsers if you are using the default authentication provided by the framework: php artisan make:auth. Laravel generated the login controller: App\Http\Controllers\Auth\LoginController There is the property protected $redirectTo = '/rotapararedirecionaraposologin'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.