Giter Site home page Giter Site logo

Comments (3)

lonnieezell avatar lonnieezell commented on May 31, 2024

Could you provide your filter setup? I'll have to dig into it but would like that additional info to make sure we're on the same page.

from myth-auth.

fefo-p avatar fefo-p commented on May 31, 2024

\App\Config\Filters

class Filters extends BaseConfig
{
	// Makes reading things below nicer,
	// and simpler to change out script that's used.
	public $aliases = [
		'csrf'       => \CodeIgniter\Filters\CSRF::class,
		'toolbar'    => \CodeIgniter\Filters\DebugToolbar::class,
		'honeypot'   => \CodeIgniter\Filters\Honeypot::class,
		'login'      => \Myth\Auth\Filters\LoginFilter::class,
		'role'       => \Myth\Auth\Filters\RoleFilter::class,
		'permission' => \Myth\Auth\Filters\PermissionFilter::class,
	];

	// Always applied before every request
	public $globals = [
		'before' => [
			'honeypot',
			// 'csrf',
			'login',
		],
		'after'  => [
			'toolbar',
			'honeypot',
		],
	];

\App\Config\Routes

// Create a new instance of our RouteCollection class.
$routes = Services::routes(true);

// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (file_exists(SYSTEMPATH . 'Config/Routes.php'))
{
	require SYSTEMPATH . 'Config/Routes.php';
}

// Load the Myth's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (file_exists(APPPATH . '../vendor/myth/auth/src/Config/Routes.php'))
{
	require APPPATH . '../vendor/myth/auth/src/Config/Routes.php';
}

/* -------------------------------------------------------------------------------------------------------*/
/* -------------------------------------------------------------------------------------------------------*/
/* -----------------------A D M I N I S T R A T O R     P R I V I L E D G E S ----------------------------*/
/* -------------------------------------------------------------------------------------------------------*/
/* -------------------------------------------------------------------------------------------------------*/

$routes->group('', ['filter' => 'role:admin,superadmin'], function ($routes) {
	// User administration
	$routes->get('users', 'Admin::index', ['as' => 'user-administration']);

	// User registration
	$routes->get('register', '\Myth\Auth\Controllers\AuthController::register', ['as' => 'user-registration']);
	$routes->post('register', '\Myth\Auth\Controllers\AuthController::attemptRegister');

	// Group registration
	$routes->get('groupRegister', 'Admin::addGroup', ['as' => 'group-registration']);
	$routes->post('groupRegister', 'Admin::attemptAddGroup');

	// Group deletion
	$routes->get('deleteGroup', 'Admin::attemptDeleteGroup', ['as' => 'group-deletion']);

	// Administration password change
	$routes->get('changePassword', 'Admin::changePassword', ['as' => 'password-change']);
	$routes->post('changePassword', 'Admin::attemptChangePassword');
});

And finally, \Myth\Auth\Filters\LoginFilter

	public function before(RequestInterface $request)
	{
		// Make sure this isn't already a login route
		if ((current_url() === site_url(route_to('login'))) || (current_url() === site_url(route_to('forgot'))) || (current_url() === site_url(route_to('reset-password'))))
		{
			return;
		}

from myth-auth.

fefo-p avatar fefo-p commented on May 31, 2024

It seems the problem had to do with a commented line in htaccess (RewriteBase = /).
Once I uncommented that line, everything started working ok.
I came to realize this because I installed my app in www.ionos.com (aka 1and1.com) and kept getting Error 500.
Once htaccess was updated to include RewriteBase, everything was fine.

from myth-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.