fixing: get product
This commit is contained in:
@@ -28,7 +28,7 @@ export class AuthService {
|
||||
username: user.username,
|
||||
sub: user.id,
|
||||
role: user.roles.name,
|
||||
partner: user.partner.id,
|
||||
partner: user.partner?.id,
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ExtractJwt, Strategy } from 'passport-jwt';
|
||||
import { PassportStrategy } from '@nestjs/passport';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import {ConfigService} from "@nestjs/config";
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
|
||||
@Injectable()
|
||||
export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||
@@ -14,6 +14,9 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||
}
|
||||
|
||||
async validate(payload: any) {
|
||||
return { userId: payload.sub, username: payload.username };
|
||||
return {
|
||||
userId: payload.sub,
|
||||
username: payload.username,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user