• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
One-stop Auth package for CodeIgniter 4

#1
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
Reply

#2
Just manually install it that's how I got it to work.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
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.
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply

#4
(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.
Reply

#5
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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.