Download the PHP package rockz/email-auth-bundle without Composer
On this page you can find all versions of the php package rockz/email-auth-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rockz/email-auth-bundle
More information about rockz/email-auth-bundle
Files in rockz/email-auth-bundle
Package email-auth-bundle
Short Description Authenticate the user by sending an authorization request to his email.
License MIT
Informations about the package email-auth-bundle
The EmailAuthBundle
This bundle provides a way to authenticate a registered user by email only. A magic link is send to the user where this request can be accepted or rejected.
Attention: This bundle is currently not ready for production!
This bundle supports symfony 4 only.
Installation
1. Download the Bundle
2. Configuration
Configure the firewall by adding the rockz_email_auth
key to it. Provide a user provider which should be used for the authentication procedure.
Import bundle specific routes.
3. Prepare your template
Insert this minimum form somewhere on your page.
The request must be a post, with the provided email_auth
parameter containing the users email.
4. Update your database
Generate migration or update your database schema right away:
5. Configure your SwiftMailer
This bundle uses the SwiftMailer to send emails to the user which is provided by the configured user provider.
Documentation: SwiftMailer configuration
6. CSRF Protection (optional)
You can enable csrf protection for your login form.
Enable the csrf_protection
under your firewall settings for rockz_email_auth
.
Add the following part to your login form:
If you haven't required symfony/form
you may do this by running
It contains twig's csrf_token
helper method.
Configuration
Most of the bundle behaviour is configured inside the firewall configuration in the security section.
Example Setup
TBD.
The following part should explain how this bundle is supposed to be used.
Import routes for the authorization controller. Create that file (btw. you can name it how ever you want).
All versions of email-auth-bundle with dependencies
symfony/security Version ^4.0
symfony/orm-pack Version ^1.0.4
doctrine/doctrine-bundle Version ^1.8.0
symfony/security-bundle Version ^4.0
symfony/twig-bundle Version ^4.0
symfony/swiftmailer-bundle Version ^3.2