rd/authentication-bundle

用户管理 & 认证组件

安装: 8

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 0

类型:symfony-bundle

0.2.0 2019-12-06 20:43 UTC

This package is auto-updated.

Last update: 2024-09-07 07:37:57 UTC


README

Packagist PHP from Packagist GitHub last commit GitHub release

概述

  • 注册
  • 账户验证
  • 登录 & 登出
  • 重置密码

这是一个完全配置好的组件。只需安装并复制/粘贴配置即可。

预览

Untitled Untitled2

安装

使用Composer安装组件

composer require rd/authentication-bundle

更新 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: /

更新 config/packages/framework.yaml

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

更新 config/routes/annotation.yaml

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

更新数据库模式

bin/console doctrine:schema:update --force

用于实际使用的配置需要 config/packages/rd_authentication.yaml

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