// Assign current_user to the instance so controllers can use it if (Config::get('auth.driver', 'Simpleauth') == 'Ormauth') { $this->current_user = Auth::check() ? Model\Auth_User::find_by_username(Auth::get_screen_name()) : null; } else { $this->current_user = Auth::check() ? Model_User::find_by_username(Auth::get_screen_name()) : null; }
Which looks ok? Ormauth uses Model\Auth_User, Simpleauth uses Model_user?
I reinstalled everything and had the same problem. This time this got it to work, not sure what the problem is but here is the code that is working now for the Controller_Base
class Controller_Base extends Controller_Hybrid {
public function before()
{
parent::before();
/**
* WanWizard had me add this so that it will work!
*
* This now works Thank you WanWizard.
*/
Config::load('auth', true);
// Assign current_user to the instance so controllers can use it
if (Config::get('auth.driver', 'Simpleauth') == 'Ormauth')
The auth config file is loaded when you access the Auth class for the first time. This code tried to access the config before Auth was used, so the config wasn't loaded.
Most people do an Auth::check() in their base controller before method, so I assume this is why this problem hasn't surfaced earlier.