实现自定义持久化器
该 Bundle 假设您正在使用 Doctrine 来存储您的用户实体。如果您正在使用其他方式,例如您的用户实体由 API 管理,您必须实现一个自定义持久化器服务。
持久化器必须实现 Scheb\TwoFactorBundle\Model\PersisterInterface
。
例如,请参阅 Bundle 提供的 Scheb
。
将其注册为服务并配置服务名称
1 2 3
# config/packages/scheb_2fa.yaml
scheb_two_factor:
persister: acme.custom_persister
本作品,包括代码示例,根据 Creative Commons BY-SA 3.0 许可协议获得许可。