You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minor issue - running the feathers authentication generator appears to scaffold an authentication service which assumes the service is always called user.
To reproduce the error generate authentication per the documenatation:
? Which authentication methods do you want to use? Other methods and providers can be added at any time. Email + Password
? What is your authentication service name? admin
? What path should the service be registered on? admins
? What database is the service using? SQL
? Which schema definition format do you want to use? Schemas allow to type, validate, secure and populate data TypeBox
(recommended)```
The file admins.schema.ts will be generated with the following minor errors:
```export const adminQueryResolver = resolve<AdminQuery, HookContext<AdminService>>({
// If there is a user (e.g. with authentication), they are only allowed to see their own data
id: async (value, user, context) => {
if (context.params.user) { <-- user does not exist
return context.params.user.id <-- user does not exist
}
return value
}
})```
Replacing the context.params.user with context.params.admin in two places resolves the issue.
Perhaps the authentication generator should read the service schema id dynamically to improve this?
The text was updated successfully, but these errors were encountered:
Minor issue - running the feathers authentication generator appears to scaffold an authentication service which assumes the service is always called user.
To reproduce the error generate authentication per the documenatation:
The text was updated successfully, but these errors were encountered: