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
With Nest 7 just released it would be helpful to have a new release that support it.
One thing that I noticed broke is the @UserRoles() decorator.
It can't find the user object on the request anymore since request is not passed into the create param decorator factory. createParamDecorator now expects a ExecutionContext instead.
From the migration docs
// Before
import { createParamDecorator } from '@nestjs/common';
export const User = createParamDecorator((data, req) => {
return req.user;
});
// After
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
export const User = createParamDecorator(
(data: unknown, ctx: ExecutionContext) => {
const request = ctx.switchToHttp().getRequest();
return request.user;
},
);
The text was updated successfully, but these errors were encountered:
ruslanguns
added a commit
to ruslanguns/nest-access-control
that referenced
this issue
May 10, 2020
Just stumbled upon this project. What’s the status on this migration? Are there more issues than #34 that need to be solved in order to be compatible with NestJS v7?
With Nest 7 just released it would be helpful to have a new release that support it.
One thing that I noticed broke is the
@UserRoles()
decorator.It can't find the user object on the request anymore since request is not passed into the create param decorator factory. createParamDecorator now expects a
ExecutionContext
instead.From the migration docs
The text was updated successfully, but these errors were encountered: