Welcome Guest, Not a member yet? Register   Sign In
Myth\Auth extending AuthController
#1

I'm trying to extend AuthController to make modifications of my own.  I've "published" the controller with the auth:publish spark module, but my application isn't using the new controller in App\controllers\AuthController.php. 

I'm sure I'm missing something stupid.  Any ideas?
Reply
#2

Did you set the route for it?
Reply
#3

I have a route set now! Thanks!

It's been awhile since I've used CodeIgniter and didn't think to configure a route to extend the controller.  Makes sense now in hindsight.  Below is what I have configured in my app\config\routes.php if anyone else makes the same mistake as me in the future (update the namespace). 

Code:
$routes->group('', ['namespace' => 'App\Controllers'], function ($routes) {
    // Login/out
    $routes->get('login', 'AuthController::login', ['as' => 'login']);
    $routes->post('login', 'AuthController::attemptLogin');
    $routes->get('logout', 'AuthController::logout');

    // Registration
    $routes->get('register', 'AuthController::register', ['as' => 'register']);
    $routes->post('register', 'AuthController::attemptRegister');

    // Activation
    $routes->get('activate-account', 'AuthController::activateAccount', ['as' => 'activate-account']);
    $routes->get('resend-activate-account', 'AuthController::resendActivateAccount', ['as' => 'resend-activate-account']);

    // Forgot/Resets
    $routes->get('forgot', 'AuthController::forgotPassword', ['as' => 'forgot']);
    $routes->post('forgot', 'AuthController::attemptForgot');
    $routes->get('reset-password', 'AuthController::resetPassword', ['as' => 'reset-password']);
    $routes->post('reset-password', 'AuthController::attemptReset');
});
Reply




Theme © iAndrew 2016 - Forum software by © MyBB