Skip to content
Snippets Groups Projects

feat: added login to people

Merged GUVEN Kemal requested to merge login into master
13 files
+ 160
8
Compare changes
  • Side-by-side
  • Inline
Files
13
+ 17
0
 
import { PassportStrategy } from "@nestjs/passport";
 
import { ExtractJwt, Strategy } from "passport-jwt";
 
import { jwtConstants } from '../constants';
 
 
export class JwtStrategy extends PassportStrategy(Strategy) {
 
constructor() {
 
super({
 
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
 
ignoreExpiration: false,
 
secretOrKey: jwtConstants.secret
 
})
 
}
 
 
async validate(payload: any) {
 
return {userId: payload.sub, email: payload.email}
 
}
 
}
 
\ No newline at end of file
Loading