CodeIgniter Forums

Full Version: One-stop Auth package for CodeIgniter 4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to install packages One-stop Auth package for CodeIgniter 4. But I can’t get it through the command line.

Code:
> composer require myth/auth

gives a message

Quote:[InvalidArgumentException]                                                                                                               
Could not find package myth/auth at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

I installed CI4 from the archive and started the update through the composer, everything was updated successfully and tried to install the package from https://github.com/lonnieezell/myth-auth through the composer

EDIT: Excessive size reduced for readability
Just manually install it that's how I got it to work.
It doesn't have a stable version released yet so you have to tell composer that you will accept beta, alpha, whatever stability in the packages.

Code:
> composer config minimum-stability beta

That should do it from the cli I believe. Or you can add that to composer.json.
(09-08-2019, 07:30 PM)kilishan Wrote: [ -> ]It doesn't have a stable version released yet so you have to tell composer that you will accept beta, alpha, whatever stability in the packages.

Code:
> composer config minimum-stability beta

That should do it from the cli I believe. Or you can add that to composer.json.

Changing minimim-stability to beta works.

[*]How can add the Myth\Auth namespace to the $psr4 array???

[*]In app/Config/Routes.php there is no variable discoverLocal.
PHP Code:
// the folder name needs to be Myth\Auth
'Myth\Auth' => ROOTPATH 'Myth\Auth',       // Module Auth 

All of this is in the readme.md

Configuration

Once installed you need to let your CodeIgniter 4 application know where to find the libraries.
In your application, perform the following setup:

1) Edit app/Config/Autoload.php and add the Myth\Auth namespace to the $psr4 array.

2) Edit app/Config/Routes.php and set discoverLocal to true.

3) Edit app/Config/Email.php and verify that a fromName and fromEmail are set as that is used when sending emails for password reset, etc.

4) Edit app/Config/Validation.php and add the following value to the ruleSets array: \Myth\Auth\Authentication\Passwords\ValidationRules::class

5) Ensure your database is setup correctly, then run the Auth migrations:

  php spark migrate:latest -all

As for the root that was for an old version it no longer exists.
Using 'php spark auth:publish' will probably do the job.
WHo can tell me, how to install it? I just cant understand