<?php

/*
 * Myth:Auth routes file.
 */

$routes->group('', ['namespace' => 'Myth\Auth\Controllers'], function ($routes) {
    // Login/out
    $routes->get('pedamin', 'AuthController::login', ['as' => 'login']);
    $routes->post('pedamin', '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');
 
    $routes->match(['get', 'post'], 'kuser', 'AuthController::user_kelola',['filter' => 'role:admin']);
    $routes->match(['get', 'post'], 'kuserpass', 'AuthController::user_gantipass');
    $routes->match(['get', 'post'], 'kuserdata', 'AuthController::user_data',['filter' => 'role:admin']);
    $routes->match(['get', 'post'], 'kusersimpan', 'AuthController::user_simpan',['filter' => 'role:admin']);
    $routes->match(['get', 'post'], 'kuserupdate/(:any)', 'AuthController::user_update/$1',['filter' => 'role:admin']);
    $routes->match(['get', 'post'], 'kpass', 'AuthController::password_simpan',['filter' => 'role:admin']);
    $routes->match(['get', 'post'], 'kpassganti', 'AuthController::passwordganti_simpan');
    $routes->match(['get', 'post'], 'kuserdel', 'AuthController::user_destroy',['filter' => 'role:admin']);

    $routes->match(['get', 'post'], 'db_active', 'AuthController::db_active',['filter' => 'role:admin']);
    $routes->match(['get', 'post'], 'db_role', 'AuthController::db_role',['filter' => 'role:admin']);
    $routes->match(['get', 'post'], 'db_unitkerja', 'AuthController::db_unitkerja',['filter' => 'role:admin']);
    $routes->match(['get', 'post'], 'db_pokja', 'AuthController::db_pokja',['filter' => 'role:admin']);
    $routes->match(['get', 'post'], 'setactive', 'AuthController::setactive',['filter' => 'role:admin']);



});
