auth a medias

This commit is contained in:
xXpuma99Xx
2022-04-21 16:31:26 -05:00
parent c52e5b7850
commit ede4bbd0dc
9 changed files with 411 additions and 10 deletions
+14
View File
@@ -0,0 +1,14 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { PassportStrategy } from '@nestjs/passport';
import { Strategy, ExtractJwt } from 'passport-jwt';
@Injectable()
export class JwtStrategyService extends PassportStrategy(Strategy) {
constructor(private configService: ConfigService) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
secretOrKey: configService.get<string>('AUTH_SECRETKEY'),
});
}
}