mirror of
https://github.com/CaramelFur/Picsur.git
synced 2026-07-12 21:43:16 +02:00
rename some auth things
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
11
backend/src/managers/auth/guards/reqtype.ts
Normal file
11
backend/src/managers/auth/guards/reqtype.ts
Normal 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>
|
||||
>;
|
||||
Reference in New Issue
Block a user