rename some auth things

This commit is contained in:
rubikscraft
2022-04-22 17:30:47 +02:00
parent 6c1fa47a77
commit 47d6c26dcf
3 changed files with 14 additions and 13 deletions

View File

@@ -1,18 +1,8 @@
import { Injectable } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { Request } from 'express';
import { ParamsDictionary } from 'express-serve-static-core';
import { Strategy } from 'passport-strategy';
import { ParsedQs } from 'qs';
import { GuestService } from '../guest.service';
type ReqType = Request<
ParamsDictionary,
any,
any,
ParsedQs,
Record<string, any>
>;
import { ReqType } from './reqtype';
class GuestPassportStrategy extends Strategy {
// Will be overridden by the nest implementation

View File

@@ -1,11 +1,11 @@
import { Inject, Injectable, Logger } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { ExtractJwt, Strategy } from 'passport-jwt';
import { ExtractJwt, Strategy as JwtPassportStrategy } from 'passport-jwt';
import { JwtDataSchema } from 'picsur-shared/dist/dto/jwt.dto';
import { EUser } from 'picsur-shared/dist/entities/user.entity';
@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
export class JwtStrategy extends PassportStrategy(JwtPassportStrategy, 'jwt') {
private readonly logger = new Logger('JwtStrategy');
constructor(@Inject('JWT_SECRET') jwtSecret: string) {

View File

@@ -0,0 +1,11 @@
import { Request } from 'express';
import { ParamsDictionary } from 'express-serve-static-core';
import { ParsedQs } from 'qs';
export type ReqType = Request<
ParamsDictionary,
any,
any,
ParsedQs,
Record<string, any>
>;