networkteam/neos-passwordreset
Composer 安装命令:
composer require networkteam/neos-passwordreset
包简介
A Neos package for users to reset their password withing the frontend.
README 文档
README
Allow users to reset their password withing the frontend.
Installation
$ composer require networkteam/neos-passwordreset
$ ./flow doctrine:migrate
Configuration
Overwrite the template paths to point to your own Templates. These can be copies from the original ones. They are lend by the great project from postmarkapp.com.
Networkteam:
Neos:
PasswordReset:
authenticationProviders:
- Networkteam.Neos.FrontendLogin:Frontend
senderAddress: 'no-reply@organisation.org'
templatePaths:
noAccountMailHtml: 'resource://Networkteam.Neos.PasswordReset/Private/Templates/Mail/password-reset-help.html'
noAccountMailTxt: 'resource://Networkteam.Neos.PasswordReset/Private/Templates/Mail/password-reset-help.txt'
resetPasswordMailHtml: 'resource://Networkteam.Neos.PasswordReset/Private/Templates/Mail/password-reset-link.html'
resetPasswordMailTxt: 'resource://Networkteam.Neos.PasswordReset/Private/Templates/Mail/password-reset-link.txt'
The configuration authenticationProviders is an array of providers a reset is possible for. When multiple providers are
given the email address is tested for each provider and the first one an account is found for creates the mail.
Policy
To make the password change functionality work, you have to add the PasswordChange privilege (Networkteam.Neos.PasswordReset:PasswordChange)
to the member area role. If you use the networkteam FrontendLogin package
it looks as follows:
Policy.yaml
roles:
'Networkteam.Neos.FrontendLogin:MemberArea':
abstract: true
privileges:
- privilegeTarget: 'Networkteam.Neos.PasswordReset:PasswordChange'
permission: GRANT
Signals
This package provides signals for certain events.
requestResetAction
| Signal name | Description | Parameters |
|---|---|---|
| accountForRequestedResetIsNotFound | is fired during requestResetAction when no account could be found for the given email address | email, authenticationProviderName |
| accountForRequestedResetIsInactive | is fired during requestResetAction when the found account is inactive | account, request, response |
| createdPasswordResetTokenForAccount | is fired during requestResetActionwhen the password reset token has been created | account, token |
| resetTokenIsInvalid | is fired during resetAction when given token is invalid | token, validationDate |
| passwordMismatchInResetAction | token, newPassword, passwordRepeat, matchedNode, matchedRedirectNode |
|
| authenticationAttemptHasBeenMade | account, newPassword, matchedNode, matchedRedirectNode |
|
| failedToAuthenticateAccount | account, newPassword, matchedNode, matchedRedirectNode |
Information flow
If the user requests a new Password an email ist sent to the given address. If no associated account could be found for the email address an email with this information is sent to inform the user that he probably used another email address for this account.
If an account was found, a token is generated to identify the request and an email is send to the user. The token is validated when the user clicks on the link in the email and submits the subsequently shown form with the new password.
Requirements / Short comings
The accounts need to have an email address as identifier aka. username. This is needed due to the nature of the underlying handling of electronic addresses in Neos. There should also be no accounts with the same email address and different authentication providers. This is possible but only for the first configured authentication provider a reset is possible.
Styling
To bring the forms in good shape for you application / website overwrite the fusion templates. There is one for each form / response.
- RequestForm is the form initially shown to enter an email address
- RequestAccepted is shown after an email was sent
- ResetForm is the form shown to give the new password
- ResetSucceeded is the fusion executed when the password reset is complete
As variables for the templates are available:
- node # the node the form was sent from - email # the email provided in the form - operating_system # a string from the referer - browser_name # a string from the referer
networkteam/neos-passwordreset 适用场景与选型建议
networkteam/neos-passwordreset 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.35k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 08 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 networkteam/neos-passwordreset 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 networkteam/neos-passwordreset 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 6.35k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2019-08-06