customers for your shop and staff for your back office, each with its own users, roles, and settings.
/auth/customers/login, /auth/staff/login.
Create a guard
1
Prepare the collection
Make sure it has a field to log in with, such as
email, username, or phone. Mark that field unique.2
Create the guard
Go to Authentication → Guards → Create guard. Enter a name (the slug is generated from it), pick the collection, and pick the login field.
3
Review what Bludia adds
- A
passwordfield on the collection, if it doesn’t have one. Values are hashed and never returned. - A default role named User (slug
user), assigned automatically to everyone who registers.
Settings
Custom login fields
The login field can be any field on the collection. Users always send it aslogin when logging in:
{ "email": "…", "password": "…" }.
Multiple guards
Use more than one guard when groups of users are truly separate: different collections, sign-up rules, or token lifetimes. Use roles within one guard when they’re the same kind of user with different access, such asuser and admin.
