Shield problem redirecting in hosting |
Hi , i have an application that work fine in localhost .
I upload file on hosting but when i try to login with shield it return on login page without error message , if i see log i have : INFO - 2025-06-13 15:53:33 --> REDIRECTED ROUTE at https://mysite.it/login it seem that not save user session: __ci_last_regenerate|i:1749823269;csrf_test_name|s:32:"06d7c9016ed344db8ac20881c5c05d79";_ci_previous_url|s:38:"https://mysite.it/index.php/login"; wath can i do ?
i try debug , i insert in LoginController in the method loginAction
a log: log_message('info', 'Inside login action'); but in log there isn't this message it seem that does'nt redirect to login action...
inspect your permission and user group. Lever shield: use these
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
(06-13-2025, 07:07 PM)luckmoshy Wrote: inspect your permission and user group. Lever shield: use these I don't tink it's a permission problem , this is method in config/auth Code: public function loginRedirect(): string and this is route : Code: $routes->group('admin', ['filter' => 'permission:admin.access', 'namespace' => 'App\Controllers\Admin'], function ($routes) { in db i have two user 1 superadmin 1 admin i try to remove 'filter' => 'permission:admin.access', but it redirect always on login
Is the session set? Also, this line looks unnecessary:
PHP Code: $url = $session->getTempdata('beforeLoginUrl') ?? setting('Auth.redirects')['login']; PHP Code: public function loginRedirect(): string
Check your Auth.php Config file and check your redirects in it.
Also make sure that your time zone is set correct. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(06-14-2025, 02:02 AM)InsiteFX Wrote: Check your Auth.php Config file and check your redirects in it. this is the time : public string $appTimezone = 'Europe/Rome'; the auth redirect is posted over: Code: public function loginRedirect(): string but it seem doesn't work login : INFO - 2025-06-14 12:25:46 --> Inside login view DEBUG - 2025-06-14 12:25:46 --> Session: Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver. i don't have in log User logged or user not logged
Did you check the loginAttemps table to see if they were logged in?
Note This redirect happens after the specified action is complete. In the case of register or login, it might not happen immediately. For example, if you have any Auth Actions specified, they will be redirected when those actions are completed successfully. If no Auth Actions are specified, they will be redirected immediately after registration or login. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Also check in Config\app.php the uriProtocol you may try different ones sometimes this can cause problems
if not set correctly. PHP Code: /** What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |