Spaces:
Running
Running
Bibhu Mishra
Add GitHub Actions CI/CD, HF Space deployment, market hours guard, and static serving
abc493d | import { Injectable } from '@nestjs/common'; | |
| import { ConfigService } from '@nestjs/config'; | |
| import { PassportStrategy } from '@nestjs/passport'; | |
| import { ExtractJwt, Strategy } from 'passport-jwt'; | |
| () | |
| export class JwtStrategy extends PassportStrategy(Strategy) { | |
| constructor(cfg: ConfigService) { | |
| super({ | |
| jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), | |
| secretOrKey: cfg.get<string>('JWT_SECRET') ?? 'stockadvisor-secret', | |
| }); | |
| } | |
| async validate(payload: { sub: number; email: string; role: string }) { | |
| return { id: payload.sub, email: payload.email, role: payload.role }; | |
| } | |
| } | |