From c670cee310807b2d9b854389904e58f1b9173ae0 Mon Sep 17 00:00:00 2001 From: Yancey Leo Date: Mon, 13 Sep 2021 04:46:57 +0800 Subject: [PATCH] feat: delete useless file --- src/auth/auth.service.ts | 17 +++++++---------- src/shared/middlewares/middleware.config.ts | 2 -- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index d1fc7f2b..6681cff4 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -68,21 +68,18 @@ export class AuthService { public async login(loginInput: LoginInput) { const { email, password, token } = loginInput - // const { success, 'error-codes': errorCodes } = await this.verifyGoogleRecaptchaToken(token) + const { success, 'error-codes': errorCodes } = await this.verifyGoogleRecaptchaToken(token) - // if (success) { - // const res = await this.validateUser(email, password) - // return this.generateJWT(email, res) - // } - - const res = await this.validateUser(email, password) - return this.generateJWT(email, res) + if (success) { + const res = await this.validateUser(email, password) + return this.generateJWT(email, res) + } - /* throw new AuthenticationError( + throw new AuthenticationError( errorCodes ? errorCodes.toString() : 'Google Recaptcha verification failed. Please try again!', - ) */ + ) } public async register(registerInput: RegisterInput) { diff --git a/src/shared/middlewares/middleware.config.ts b/src/shared/middlewares/middleware.config.ts index abf0d9db..7e097593 100644 --- a/src/shared/middlewares/middleware.config.ts +++ b/src/shared/middlewares/middleware.config.ts @@ -5,7 +5,6 @@ import bodyParser from 'body-parser' import morgan from 'morgan' import helmet from 'helmet' import rateLimit from 'express-rate-limit' -import { graphqlUploadExpress } from 'graphql-upload' import { CORS_ORIGINS } from '../constants' export const configMiddlewares = (app: INestApplication) => { @@ -35,5 +34,4 @@ export const configMiddlewares = (app: INestApplication) => { max: 100, }), ) - // app.use(graphqlUploadExpress({ maxFileSize: 10000000, maxFiles: 10 })) }