feat: registration jounrey for parents

This commit is contained in:
Abdalhamid Alhamad
2024-12-05 11:14:18 +03:00
parent e4b69a406f
commit 2577f2dcac
97 changed files with 2269 additions and 17 deletions

View File

@ -0,0 +1,20 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { PassportStrategy } from '@nestjs/passport';
import { ExtractJwt, Strategy } from 'passport-jwt';
import { IJwtPayload } from '../interfaces';
@Injectable()
export class AccessTokenStrategy extends PassportStrategy(Strategy, 'access-token') {
constructor(configService: ConfigService) {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
ignoreExpiration: false,
secretOrKey: configService.get<string>('JWT_ACCESS_TOKEN_SECRET'),
});
}
validate(payload: IJwtPayload) {
return payload;
}
}