Function: AuthUser()
AuthUser(...
dataOrPipes
):ParameterDecorator
Decorator that takes a property name as key, and returns the associated value if it exists (or undefined if it doesn't exist, or if the user object has not been created).
Parameters
Parameter | Type |
---|---|
...dataOrPipes | (string | PipeTransform <any , any > | Type <PipeTransform <any , any >>)[] |
Returns
ParameterDecorator
Example
@Get()
async findOne(@AuthUser('firstName') firstName: string) {
console.log(`Hello ${firstName}`);
}
Defined in
packages/nestjs-common/src/decorators/auth-user.decorator.ts:17 (opens in a new tab)