Welcome Guest, Not a member yet? Register   Sign In
Myth\Auth extending AuthController
#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


Messages In This Thread
Myth\Auth extending AuthController - by navblue - 12-15-2021, 09:00 AM
RE: Myth\Auth extending AuthController - by navblue - 12-16-2021, 05:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB