nestjs-jwt

NestJS jwt-passport Authentication

我怕爱的太早我们不能终老 提交于 2020-07-06 20:26:25
问题 I want to implement a distributable authentication library to use it on several of my projects. The library should implement JWT authentication method. The code is as follows: jwt.strategy.ts: import {ExtractJwt, Strategy} from 'passport-jwt'; import {PassportStrategy} from '@nestjs/passport'; import {Injectable} from '@nestjs/common'; import {JwtPayload, User} from './interfaces'; import {ConfigService} from "./config.service"; @Injectable() export class JwtStrategy extends PassportStrategy

NestJS jwt-passport Authentication

家住魔仙堡 提交于 2020-07-06 20:26:10
问题 I want to implement a distributable authentication library to use it on several of my projects. The library should implement JWT authentication method. The code is as follows: jwt.strategy.ts: import {ExtractJwt, Strategy} from 'passport-jwt'; import {PassportStrategy} from '@nestjs/passport'; import {Injectable} from '@nestjs/common'; import {JwtPayload, User} from './interfaces'; import {ConfigService} from "./config.service"; @Injectable() export class JwtStrategy extends PassportStrategy