User Bundle Register And Reset Password
This guide covers the public account onboarding flows:
- self-registration
- email confirmation
- reset password request
- reset password completion
These are the routes you enable when your application is not admin-only.
Enable Registration Routes
Import the register routes:
_sfs_register:
resource: '@SfsUserBundle/config/routing/register.yaml'
prefix: '/register'
This exposes:
sfs_user_registersfs_user_register_successsfs_user_register_confirm
Then make the route public:
security:
access_control:
- { path: ^/app/register, roles: PUBLIC_ACCESS }
Entity Requirements For Registration
Registration works best when your user entity implements:
UserPasswordInterface- one identifier interface
- usually
UserIdentifierEmailInterface
- usually
ConfirmableInterfaceif you want confirmation emails
Optional but common:
NameSurnameInterfaceUserHasLocalePreferenceInterface
The register template already adapts to optional fields such as name, surname, username, and email.
Email Confirmation Flow
The confirmation flow is enabled by default:
sfs_user:
confirm_email:
enabled: true
When a user registers and your entity implements ConfirmableInterface:
- the user is persisted
- a confirmation token is generated
- the confirmation email listener sends the email
- the user confirms through
sfs_user_register_confirm
That means you usually want:
- a configured mailer
- a concrete
Userentity with confirmation fields - public access to the confirmation URL
If your project should allow direct login immediately after register, disable confirmation or customize the registration event flow.
Reset Password Routes
Import the reset password routes:
_sfs_reset_password:
resource: '@SfsUserBundle/config/routing/reset_password.yaml'
prefix: '/reset-password'
This exposes:
sfs_user_reset_password_requestsfs_user_reset_password_requestedsfs_user_reset_passwordsfs_user_reset_password_success
And it must stay public:
security:
access_control:
- { path: ^/app/reset-password, roles: PUBLIC_ACCESS }
Entity Requirements For Reset Password
Your user entity must implement PasswordRequestInterface.
That adds:
- password request token
- password requested timestamp
Without that interface, the reset email can be requested but the bundle has no place to store the token correctly.
Token Lifetime
Configure the token TTL like this:
sfs_user:
reset_password:
token_ttl: 86400
This value is used by the bundle templates and flow configuration.
For most applications, one day is a reasonable default.
Real Project Patterns
Self-Service SaaS
Enable register, confirmation email, and reset password.
This is the usual setup for public products where users create their own accounts.
Internal Tool With Manual Provisioning
Disable registration and keep only reset password.
This is common when users are created by staff, but still need a standard way to recover their password.
Invitation-Only B2B Product
Disable registration and use invitations instead.
That keeps onboarding controlled while reusing the same authentication and settings layers.
Interaction With Account Bundle
Some projects combine user-bundle with account-bundle.
A common pattern is:
- register the user with
user-bundle - create the first business account with
account-bundle - redirect to the account onboarding flow
In armonic-standalone, the user register route is currently disabled because the project can route sign-up into a more specific application flow.
Troubleshooting
- Registration page is missing:
Check that the register route group is imported. - Register works but no email is sent:
Check mailer configuration andConfirmableInterface. - Reset password page loads but token reset never completes:
CheckPasswordRequestInterfaceon the user entity. - Register route is public but still redirects:
Check the firewall pattern andaccess_controlorder.
Related Guides
- Install for the base entity, routes, and initial
sfs_userconfiguration. - Login and security for the firewall and public access rules this flow depends on.
- User settings pages to continue with authenticated self-service actions after onboarding.
- Invitations and access history if the project should not allow public registration.