`getUserFromRequest` typing issues
Closed this issue · 2 comments
andreialecu commented
It appears that getUserFromRequest
allows returning an object that doesn't contain a roles
field.
The roles
field seems to be hardcoded in other places, and is required. Here's a simple repro:
type User = { name: string };
CaslModule.forRoot<Roles, User>({
getUserFromRequest: (request) => {
return {
name: 'test',
};
},
This leads to errors further down. Ideally, the signature of getUserFromRequest
would verify that a AuthorizableUser<T>
is being returned.
ruscon commented
try the new version npm i nest-casl@1.4.3
liquidautumn commented
@andreialecu should be good > 1.4.3, I'll close for now, feel free to reopen if needed