Skip to content

Commit

Permalink
code prettified
Browse files Browse the repository at this point in the history
  • Loading branch information
varsha766 committed Nov 10, 2023
1 parent 59cbb9b commit 0e4c65e
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/app-auth/strategy/jwt.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import { ConfigService } from '@nestjs/config';
import { PassportStrategy } from '@nestjs/passport';
import { Strategy, ExtractJwt } from 'passport-jwt';
import { AppRepository } from '../repositories/app.repository';
import { AppAuthSecretService } from '../services/app-auth-passord.service';
@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
constructor(
private readonly config: ConfigService,
private readonly appRepository: AppRepository,
private readonly appAuthSecretService: AppAuthSecretService,
) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
Expand All @@ -24,22 +22,3 @@ export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
return appDetail;
}
}

@Injectable()
export class JwtStrategyApp extends PassportStrategy(Strategy, 'jwtApp') {
constructor(
private readonly config: ConfigService,
private readonly appRepository: AppRepository,
private readonly appAuthSecretService: AppAuthSecretService,
) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
ignoreExpiration: false,
secretOrKey: config.get('STUDIO_SERVER_JWT_SECRET'),
});
}
async validate(payload) {
payload.userId = payload.email;
return payload;
}
}

0 comments on commit 0e4c65e

Please sign in to comment.