Skip to content

rdurica/authentication-bundle

Repository files navigation

RD Authentication Bundle

Packagist PHP from Packagist GitHub last commit GitHub release

Overview

  • Registration
  • Account verify
  • Login & logout
  • Reset password

This is fully configured bundle. Just install & copy/paste configuration.

Preview

Untitled Untitled2

Installation

Install bundle with Composer:

composer require rd/authentication-bundle

Update config/packages/security.yaml

security:
    encoders:
        Rd\AuthenticationBundle\Entity\User:
            algorithm: bcrypt
    providers:
        database_provider:
            entity:
                class: Rd\AuthenticationBundle\Entity\User
    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            anonymous: ~
            provider: database_provider
            form_login:
                login_path: rd_authentication_login
                check_path: rd_authentication_login
                csrf_token_generator: security.csrf.token_manager
            logout:
                path: rd_authentication_logout
                target: /

Update config/packages/framework.yaml

framework:
    secret: '%env(APP_SECRET)%'
    csrf_protection: true

Update config/routes/annotation.yaml

rd_authentication:
    resource: ../../vendor/rd/authentication-bundle/Controller/
    type: annotation

Update database schema

bin/console doctrine:schema:update --force

Configuration needed for live usage config/packages/rd_authentication.yaml

rd_authentication:
  homepage: 'http://localhost'
  background: 'http://getwallpapers.com/wallpaper/full/a/5/d/544750.jpg'
  email:
    from: 'no-reply@localhost.net'