mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-17 01:56:28 +03:00
Fastfony Identity bundle - improve post-install documentation and enable registration (#1966)
* docs: improve post-install documentation and enable registration by default * docs: remove customization class, improve post install
This commit is contained in:
@@ -1,20 +1,13 @@
|
||||
fastfony_identity:
|
||||
user:
|
||||
# Your custom User entity class extends Fastfony\IdentityBundle\Entity\Identity\User (optional)
|
||||
#class: 'App\Entity\User'
|
||||
#require_email_verification: true # Require email verification for new users (default: false)
|
||||
role:
|
||||
# Your custom Role entity class extends Fastfony\IdentityBundle\Entity\Identity\Role (optional)
|
||||
#class: 'App\Entity\Role'
|
||||
# Default role assigned to new users (if you want to assign one different from ROLE_USER)
|
||||
#default_role: 'ROLE_ADMIN'
|
||||
group:
|
||||
# Your custom Group entity class extends Fastfony\IdentityBundle\Entity\Identity\Group (optional)
|
||||
#class: 'App\Entity\Group'
|
||||
login:
|
||||
#default_method: 'login_link' # Default login method: 'form_login' or 'login_link' (default: 'form_login')
|
||||
registration:
|
||||
#enabled: true # Enable or disable user registration (default: false)
|
||||
enabled: true # Enable or disable user registration (default: false)
|
||||
login_link:
|
||||
#enabled: false # Enable or disable login via email link (default: true)
|
||||
#email_subject: 'Your login link' # Subject of the email sent with the login link (text or translation key)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
{
|
||||
"file": "config/packages/security.yaml",
|
||||
"content": "\n fastfony_identity:\n lazy: true\n provider: fastfony_identity_user_provider\n user_checker: Fastfony\\IdentityBundle\\Security\\UserChecker\n form_login:\n login_path: form_login\n check_path: form_login\n enable_csrf: true\n csrf_token_id: login\n form_only: true\n login_link:\n check_route: login_check\n signature_properties: [ id, email ]\n max_uses: 3\n entry_point: Fastfony\\IdentityBundle\\Security\\CustomEntryPoint\n remember_me:\n always_remember_me: true\n signature_properties: [ 'id', 'email', 'password' ]\n switch_user: true\n login_throttling:\n max_attempts: 3\n logout:\n path: /logout\n clear_site_data:\n - cookies\n - storage\n\n",
|
||||
"content": "\n fastfony_identity:\n lazy: true\n provider: fastfony_identity_user_provider\n user_checker: Fastfony\\IdentityBundle\\Security\\UserChecker\n form_login:\n login_path: form_login\n check_path: form_login\n enable_csrf: true\n csrf_token_id: login\n form_only: true\n default_target_path: fastfony_identity_secure_area\n login_link:\n check_route: login_check\n signature_properties: [ id, email ]\n max_uses: 3\n default_target_path: fastfony_identity_secure_area\n entry_point: Fastfony\\IdentityBundle\\Security\\CustomEntryPoint\n remember_me:\n always_remember_me: true\n signature_properties: [ 'id', 'email', 'password' ]\n switch_user: true\n login_throttling:\n max_attempts: 3\n logout:\n path: /logout\n clear_site_data:\n - cookies\n - storage\n\n",
|
||||
"position": "after_target",
|
||||
"target": " security: false",
|
||||
"warn_if_missing": true
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<info>Fastfony/IdentityBundle is almost ready:</info>
|
||||
|
||||
1. A <fg=yellow>config/packages/fastfony_identity.yaml</> and a <fg=yellow>config/routes/fastfony_identity.yaml</> file has been created for you.
|
||||
1. The <comment>config/packages/security.yaml</comment> and <comment>config/packages/stof_doctrine_extensions.yaml</comment> files have been updated where the expected configuration lines were found; please verify these changes.
|
||||
|
||||
2. The <fg=yellow>config/packages/security.yaml</> and <fg=yellow>config/packages/stof_doctrine_extensions.yaml</> files have been updated where the expected configuration lines were found; please verify these changes.
|
||||
2. Merge the content of <comment>config/packages/mailer.yaml.dist</comment> into your <comment>config/packages/mailer.yaml</comment> file and set your <comment>MAILER_DSN</comment> environment variable if it is not already done.
|
||||
|
||||
3. Merge the content of <fg=yellow>config/packages/mailer.yaml.dist</> into your <fg=yellow>config/packages/mailer.yaml</> file and set your <fg=yellow>MAILER_DSN</> environment variable if it is not already done.
|
||||
|
||||
4. Create the database schema:
|
||||
3. Create the database schema:
|
||||
|
||||
Option 1 - Generate and run migrations to create the database tables:
|
||||
|
||||
@@ -17,4 +15,14 @@
|
||||
|
||||
<fg=green>php bin/console doctrine:schema:update --force</>
|
||||
|
||||
<info>Enjoy!</info>
|
||||
4. Use the bundle:
|
||||
|
||||
Option 1 - Create an user with command:
|
||||
|
||||
<fg=green>php bin/console fastfony:user:create</>
|
||||
|
||||
Option 2 - Create an user on browser (if registration is enabled):
|
||||
|
||||
Go to the <comment>/register</comment> route. Please be sure that your MAILER_DSN is correctly configure and sending messages async is disabled (or your messages consumer command is running) for receive the login link e-mail.
|
||||
|
||||
<info>By default, routes behind /secure-area require the user logged in.</info>
|
||||
|
||||
Reference in New Issue
Block a user