chore: cleaned unwanted imports in auth module

This commit is contained in:
Balu Babu
2023-01-20 00:04:01 +05:30
parent 53571a7d72
commit 509604833e
5 changed files with 6345 additions and 5 deletions

View File

@@ -18,13 +18,12 @@ import {
@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
constructor(
private usersService: UserService,
private authService: AuthService,
) {
constructor(private usersService: UserService) {
super({
jwtFromRequest: ExtractJwt.fromExtractors([
(request: Request) => {
console.log('here1', request.cookies);
const ATCookie = request.cookies['access_token'];
if (!ATCookie) {
throw new ForbiddenException(COOKIES_NOT_FOUND);
@@ -38,6 +37,7 @@ export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
async validate(payload: AccessTokenPayload) {
if (!payload) throw new ForbiddenException(INVALID_ACCESS_TOKEN);
console.log('here', payload);
const user = await this.usersService.findUserById(payload.sub);
if (O.isNone(user)) {