nette / sandbox
Installs: 61 994
Dependents: 1
Suggesters: 0
Security: 0
Stars: 8
Watchers: 6
Forks: 8
Open Issues: 0
Type:project
Requires
- php: >=7.4
- latte/latte: ^2.11 || ^3.0
- nette/application: ^3.1
- nette/bootstrap: ^3.1
- nette/database: ^3.1
- nette/di: ^3.0
- nette/forms: ^3.1
- nette/http: ^3.1
- nette/robot-loader: ^3.3
- nette/security: ^3.1
- nette/utils: ^3.2
- tracy/tracy: ^2.8
This package is auto-updated.
Last update: 2023-03-14 01:03:56 UTC
README
Example of user management.
- User login, registration and logout (
SignPresenter
) - Command line registration (
bin/create-user.php
) - Authentication using database table (
UserFacade
) - Password hashing
- Presenter requiring authentication (
DashboardPresenter
) using theRequireLoggedUser
trait - Rendering forms using Bootstrap CSS framework
- Automatic CSRF protection using a token when the user is logged in (
FormFactory
) - Separation of form factories into independent classes (
SignInFormFactory
,SignUpFormFactory
) - Return to previous page after login (
SignPresenter::$backlink
)
Installation
git clone https://github.com/nette-examples/user-authentication
cd user-authentication
composer install
Set the database access data in the config/local.neon
file:
database: dsn: 'mysql:host=127.0.0.1;dbname=***' user: *** password: ***
And create a users table in the database by importing the users.mysql.sql
file
The simplest way to get started is to start the built-in PHP server in the root directory of your project:
php -S localhost:8000 www/index.php
Then visit http://localhost:8000
in your browser to see the welcome page.
It requires PHP version 7.4 or newer.