devsavage / slim-3-authentication
An authentication system using the Slim Framework.
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 42
Watchers: 6
Forks: 12
Open Issues: 2
Type:project
Requires
- php: >=5.6.0 ^7.2
- google/recaptcha: ~1.1
- hassankhan/config: ^0.10.0
- illuminate/database: ^5.2
- illuminate/pagination: ^5.2
- ircmaxell/random-lib: ^1.1
- phpmailer/phpmailer: ^5.2
- robmorgan/phinx: ^0.10.7
- slim/csrf: ^0.6.0
- slim/flash: ^0.1.0
- slim/slim: ^3.0
- slim/twig-view: ^2.0
- symfony/console: ^3.1
- vlucas/phpdotenv: ^3
This package is auto-updated.
Last update: 2025-02-25 07:48:37 UTC
README
A very easy to use Slim 3 authentication system.
If you stumble upon any vulnerabilities within this package, more importantly with the role/permission system, please send your findings to: savage@savagedev.io.
Getting Started
Prerequisites
You will need the following to get started:
- A web server with URL rewriting
- PHP 5.5 or newer
- A SSL certificate will be required in production environments! Check out HTTPS Is Easy for help setting this up!
Installing
Clone the project:
git clone https://github.com/devsavage/slim-3-authentication.git your-project-name
Install the composer dependencies:
$ cd your-project-name && composer install
Inside your project folder, install the node dependencies using yarn or npm:
$ yarn install
Rename .env-example to .env
Update .env to your project's configuration
APP_ENV=development
You will need to update the APP_ENV variable to "production" when serving your application outside of a local environment!
Build assets (prodution or development)
$ yarn prod
$ yarn dev
Database and Admin
- Import auth.sql file to your database.
- Open your site, register a new user and click on activation link sent to your email
- Go to phpMyAdmin, select user_roles table and insert a new record. Select your user on user_id field, select "superadmin" on role_id field and confirm.
- Login on site to see "Admin Dashboard" on header menu
Migrations and Seeds
Create migration file
php phinx create MigrationName
Create seed file
php phinx seed:create SeedName
Run migrations
php phinx migrate
Run seeds
php phinx seed:run
Use php phinx
on terminal to see all available command list.
You will also need Google reCAPTCHA API keys. Get them here.
If you would like to completely disable reCAPTCHA, see this page
Check out the wiki for more information and details on how to add new controllers, routes and more.
License
This project is licensed under the MIT License - see the LICENSE file for details