Closed malozaibi closed 1 year ago
To confirm, are you able to access the /languages
route manually after logging in?
To confirm, are you able to access the
/languages
route manually after logging in?
Yes it redirect to the home
Note: I am using laravel/ui bootstrap auth
I was able to solve this issue manually by cuting the routes form your route file and past them in my own route with middleware auth
Full step top reproduces
composer create-project laravel/laravel .
compsoer require laravel/ui
php artisan ui bootstrap --auth
npm install
npm run build
@ set the DB in .env
php artisan migrate
composer require joedixon/laravel-translation
php artisan vendor:publish --provider="JoeDixon\Translation\TranslationServiceProvider"
@ edit translations.php and add auth middleware
I found the issue, because the route is outsite the web.php in this case a external package, the auth middleware need to be run with web
Thanks to https://stackoverflow.com/questions/35160144/authuser-returns-null
So if you set it like this it work fine
'route_group_config' => [
'middleware' => ['web', 'auth'],
],
I hope it will help!
Thank you very much @dansleboby this solution worked for me.
Describe the bug Using the Auth middleware make the /languages link to redirect to login and never return to the page. (it keeps returning to login after each successful login)
To Reproduce Steps to reproduce the behavior:
'route_group_config' => [ 'middleware' => 'auth', ],
Expected behavior It should open the /languages after login or if previously logged in show it immediately
versions
Please fix it, Thank you