Please expand the usefulness of the Security Provider
With the aid Claude Sonnet the 4th, I managed to expand the usefulness of the Security Provider from this structure:
{
"name": "secUsers",
"module": "auth",
"action": "provider",
"options": {
"secret": "TwMIMu2aNErKWEZ",
"provider": "Database",
"connection": "db",
"users": {
"table": "users",
"identity": "UserID",
"username": "UserEmail",
"password": "UserPassword"
},
"permissions": {}
},
"meta": [
{
"name": "identity",
"type": "text"
}
]
}
to this structure:
{
"name": "security",
"module": "auth",
"action": "provider",
"options": {
"secret": "BOLYLicauGzLLt4",
"provider": "Database",
"connection": "inductease",
"passwordVerify": true,
"users": {
"table": "employee_login_view",
"identity": "credential_id",
"username": "email",
"password": "password_hash",
"identityFields": [
"credential_id",
"employee_id",
"company_id",
"first_name",
"last_name",
"role",
"induction_status",
"position",
"department_id",
"is_active",
"email"
]
},
"permissions": {}
},
"meta": [
{
"name": "identity",
"type": "object",
"sub": [
{"name": "credential_id", "type": "number"},
{"name": "employee_id", "type": "number"},
{"name": "company_id", "type": "number"},
{"name": "first_name", "type": "text"},
{"name": "last_name", "type": "text"},
{"name": "role", "type": "text"},
{"name": "induction_status", "type": "text"},
{"name": "position", "type": "text"},
{"name": "department_id", "type": "number"},
{"name": "is_active", "type": "boolean"},
{"name": "email", "type": "text"}
]
}
]
}
The benefit from the expanded Security Provider
- Direct access to the data
- No separate (employee) lookup needed
- Better performance due to a single database query