CodeIgniter Forums
One-stop Auth package for CodeIgniter 4 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: One-stop Auth package for CodeIgniter 4 (/showthread.php?tid=74295)



One-stop Auth package for CodeIgniter 4 - midav - 09-07-2019

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


RE: One-stop Auth package for CodeIgniter 4 - InsiteFX - 09-07-2019

Just manually install it that's how I got it to work.


RE: One-stop Auth package for CodeIgniter 4 - kilishan - 09-08-2019

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.


RE: One-stop Auth package for CodeIgniter 4 - SirTom - 10-25-2019

(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.


RE: One-stop Auth package for CodeIgniter 4 - InsiteFX - 10-26-2019

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.


RE: One-stop Auth package for CodeIgniter 4 - TimZ - 10-26-2019

Using 'php spark auth:publish' will probably do the job.


RE: One-stop Auth package for CodeIgniter 4 - mrguseynov - 01-27-2020

WHo can tell me, how to install it? I just cant understand


RE: One-stop Auth package for CodeIgniter 4 - Ivedsnov - 11-22-2020

I cant understand too