1084

Automatically my website is routing to BASE_URL/trongate_administrators/login

Comments for “...”
 

Posted by siri on Monday 8th July 2024 at 07:31 GMT

Hi,
Here is my config file
<?php
define('BASE_URL', 'https://mybaseurl/');
define('ENV', 'prod');
define('DEFAULT_MODULE', 'dashboard');
define('DEFAULT_CONTROLLER', 'Dashboard');
define('DEFAULT_METHOD', 'index');
define('MODULE_ASSETS_TRIGGER', '_module');
define('INTERCEPT_404', 'trongate_pages/attempt_display');

Eventhough I have default controller dashboard,my webiste is redirecting to https://mybaseurl/trongate_administrators/login
I am not able to figure it out. Please help me out.
Best Regards,
Siri K
Early Adopter

siri

User Level: Early Adopter

Date Joined: 19/07/2019

Posted by DaFa on Monday 8th July 2024 at 09:33 GMT

Hi Siri,

Please post your index method of Dashboard.php
define('DEFAULT_MODULE', 'dashboard');
define('DEFAULT_CONTROLLER', 'Dashboard');
define('DEFAULT_METHOD', 'index');
Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

Posted by siri on Monday 8th July 2024 at 10:23 GMT

Hi Simon,
Here is my index method
<?php
class Dashboard extends Trongate {

	function index() {
	//$this->module('trongate_security');
        //$data['token'] = $this->trongate_security->_make_sure_allowed('members area');        
        ## based on this token get the user details
        $data['view_module'] = 'dashboard';
        $data['view_file'] = 'dashboard';                
        $data['news_count'] = 40;
        $data['blog_count'] = 20;
        $data['member_count'] = 30;
        $data['job_applications'] = 10;
        $data['conversations']  = Modules::run('conversations/index/');
    	$this->template('phoenix', $data);
	}

} // end class

This comment was edited by siri on Monday 8th July 2024 at 10:24 GMT

Early Adopter

siri

User Level: Early Adopter

Date Joined: 19/07/2019

Posted by Fin Motolinia on Monday 8th July 2024 at 14:27 GMT

I have had this problem caused by trongate security and a method calling on _make_sure_allowed(), redirecting to admin login. Perhaps try using trongate token method to get user info instead? This video may help
https://www.youtube.com/watch?v=miEPTke00fk&t=5s

This comment was edited by Fin Motolinia on Monday 8th July 2024 at 14:30 GMT

Level One Member

Fin Motolinia

User Level: Level One Member

Date Joined: 18/01/2024

Posted by siri on Tuesday 9th July 2024 at 12:22 GMT

Hi,
But I am not using the security check. I already commented those two lines.
//$this->module('trongate_security');
//$data['token'] = $this->trongate_security->_make_sure_allowed('members area');

This comment was edited by siri on Tuesday 9th July 2024 at 12:23 GMT

Early Adopter

siri

User Level: Early Adopter

Date Joined: 19/07/2019

Posted by Fin Motolinia on Wednesday 10th July 2024 at 00:09 GMT

Hello, Are you using a public template?

It looks like your calling on another module as well- 'Conversations', could that index be causing the redirect? Try plugging your Dashboard module into a fresh Trongate apps 'Welcome' module / re-name it to welcome and what not and see if the problem persists without the dependency. Many of my issues are caused my something very small being overlooked or added and most I never figured out just started over and never saw the problem again. Your issue is one of them.

This comment was edited by Fin Motolinia on Wednesday 10th July 2024 at 00:20 GMT

Level One Member

Fin Motolinia

User Level: Level One Member

Date Joined: 18/01/2024

Posted by siri on Thursday 11th July 2024 at 07:56 GMT

Hi,
No, I am not using public template. I am using some other bootstrap template. But this is working fine on my localhost. I am getting issue on live.
Best Regards,
Siri K
Early Adopter

siri

User Level: Early Adopter

Date Joined: 19/07/2019

Posted by DaFa on Friday 12th July 2024 at 10:41 GMT

Hi Siri,

Please insert die('check1'); statements to track down the redirect

It looks very obvious the redirect issue you are having is going on in here.
$data['conversations'  = Modules::run('conversations/index/');
Also, search your app for checks on "(ENV" as looks to me your user is not logged in and being redirected when the app is not in 'dev' mode.

This comment was edited by DaFa on Friday 12th July 2024 at 10:43 GMT

Founding Member

DaFa

User Level: Founding Member

Date Joined: 30/11/2018

×